diff --git a/Rocksolid_Light/common/register.php b/Rocksolid_Light/common/register.php index e0879a2..8a5388a 100644 --- a/Rocksolid_Light/common/register.php +++ b/Rocksolid_Light/common/register.php @@ -6,6 +6,7 @@ $title .= ' - Register'; include "head.inc"; $logfile = $spooldir . '/log/register.log'; +$mail_log = $spooldir . '/log/mail.log'; # $workpath: Where to cache users (must be writable by calling program) $workpath = $config_dir . "users/"; @@ -445,7 +446,7 @@ function change_user_password($username, $password) function send_reset_email($username, $user_email) { - global $CONFIG, $config_dir, $spooldir, $keys; + global $CONFIG, $config_dir, $spooldir, $mail_log, $keys; $email = trim(strtolower($user_email)); @@ -530,10 +531,12 @@ function send_reset_email($username, $user_email) $msg .= "Note: replies to this email address are checked daily."; $mail->Body = wordwrap($msg, 70); - if (!$mail->send()) { + if (!$mail->send()) { echo 'The message could not be sent.'; echo '
Error: ' . htmlentities($mail->ErrorInfo);
+ file_put_contents($mail_log, "\n" . format_log_date() . ' FAILED to send mail from: ' . $mail_user . '@' . $mail_domain . ' to: ' . $user_email . 'Error: ' . $mail->ErrorInfo, FILE_APPEND);
} else {
+ file_put_contents($mail_log, "\n" . format_log_date() . ' SENT mail from: ' . $mail_user . '@' . $mail_domain . ' to: ' . $user_email, FILE_APPEND);
echo 'An email has been sent to ' . $user_email . '
';
echo 'Please enter the code from the email below:
';
echo '