$newPass = substr($rndPassEnc, 1, 12); $newPassEnc = encr($newPass); $mailBody = '<p>Hello ' . $srm->Get('real_name') . ',</p>'; $mailBody .= '<p><strong>Your new password:</strong> ' . $newPass . '</p>'; $mailBody .= '<p>Do not forget to change your password after logged in.</p>'; $mailBody .= '<p>Thank you!</p>'; $rcMail = showIn($srm->Get('mail'), 'page'); $rcName = showIn($srm->Get('real_name'), 'page'); $rcSubject = showIn(letheglobal_password_recovery, 'page'); $rcBody = $mailBody; $rcAltBody = $mailBody; $recData = array($rcMail => array('name' => $rcName, 'subject' => $rcSubject, 'body' => $rcBody, 'altbody' => $rcAltBody)); $sendMail = new lethe(); $sendMail->sub_mail_id = md5($rcMail . time()); $sendMail->sub_mail_receiver = $recData; $sendMail->sysSubInit(); if ($sendMail->sendPos) { # Change Password $upPass = $myconn->prepare("UPDATE " . db_table_pref . "users SET pass=? WHERE ID=" . (int) $srm->Get('ID') . "") or die(mysqli_error($myconn)); $upPass->bind_param('s', $newPassEnc); $upPass->execute(); $upPass->close(); $pwrm_res = mysql_prep(errMod(subscribers_e_mail_sent_successfully, 'success')); } else { $pwrm_res = mysql_prep(errMod(letheglobal_error_occured . '<br>ERROR:' . $sendMail->sendingErrors, 'danger')); } # End } $opUser->close(); } }