mirror of
https://github.com/slawkens/myaac.git
synced 2025-06-12 15:54:29 +02:00
Save mailer error messages to file (always)
Filename: mailer-error.log This will help debugging mail sending for new users
This commit is contained in:
parent
e11d70de46
commit
9b3dbdc54f
@ -54,7 +54,7 @@ if(strlen($subject) > 255) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!_mail($email_account_name, $subject, $message)) {
|
if(!_mail($email_account_name, $subject, $message)) {
|
||||||
echo 'Error while sending mail: ' . $mailer->ErrorInfo . PHP_EOL;
|
echo 'An error occurred while sending email. More info can be found in system/logs/mailer-error.log';
|
||||||
exit(6);
|
exit(6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -878,7 +878,14 @@ function _mail($to, $subject, $body, $altBody = '', $add_html_tags = true)
|
|||||||
$mailer->AltBody = strip_tags(preg_replace('/<a(.*)href="([^"]*)"(.*)>/','$2', $body)) . "\n" . $signature_plain;
|
$mailer->AltBody = strip_tags(preg_replace('/<a(.*)href="([^"]*)"(.*)>/','$2', $body)) . "\n" . $signature_plain;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $mailer->Send();
|
ob_start();
|
||||||
|
if(!$mailer->Send()) {
|
||||||
|
log_append('mailer-error.log', PHP_EOL . $mailer->ErrorInfo . PHP_EOL . ob_get_clean());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ob_end_clean();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
function convert_bytes($size)
|
function convert_bytes($size)
|
||||||
|
@ -69,7 +69,7 @@ else
|
|||||||
if(_mail($account_logged->getEMail(), $config['lua']['serverName']." - Changed password", $mailBody))
|
if(_mail($account_logged->getEMail(), $config['lua']['serverName']." - Changed password", $mailBody))
|
||||||
$message = '<br/><small>Your new password were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
|
$message = '<br/><small>Your new password were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
|
||||||
else
|
else
|
||||||
$message = '<br/><p class="error">An error occorred while sending email with password:<br/>' . $mailer->ErrorInfo . '</p>';
|
$message = '<br/><p class="error">An error occurred while sending email. For Admin: More info can be found in system/logs/mailer-error.log</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$twig->display('success.html.twig', array(
|
$twig->display('success.html.twig', array(
|
||||||
|
@ -31,7 +31,7 @@ if(isset($_POST['registeraccountsave']) && $_POST['registeraccountsave'] == "1")
|
|||||||
if(_mail($account_logged->getEMail(), $config['lua']['serverName']." - Recovery Key", $mailBody))
|
if(_mail($account_logged->getEMail(), $config['lua']['serverName']." - Recovery Key", $mailBody))
|
||||||
$message = '<br /><small>Your recovery key were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
|
$message = '<br /><small>Your recovery key were send on email address <b>'.$account_logged->getEMail().'</b>.</small>';
|
||||||
else
|
else
|
||||||
$message = '<br /><p class="error">An error occorred while sending email with recovery key! You will not receive e-mail with this key. Error:<br/>' . $mailer->ErrorInfo . '</p>';
|
$message = '<br /><p class="error">An error occurred while sending email. For Admin: More info can be found in system/logs/mailer-error.log</p>';
|
||||||
}
|
}
|
||||||
$twig->display('success.html.twig', array(
|
$twig->display('success.html.twig', array(
|
||||||
'title' => 'Account Registered',
|
'title' => 'Account Registered',
|
||||||
|
@ -40,7 +40,7 @@ else
|
|||||||
$message = '<br />Your recovery key were send on email address <b>'.$account_logged->getEMail().'</b> for '.$config['generate_new_reckey_price'].' premium points.';
|
$message = '<br />Your recovery key were send on email address <b>'.$account_logged->getEMail().'</b> for '.$config['generate_new_reckey_price'].' premium points.';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$message = '<br /><p class="error">An error occorred while sending email ( <b>'.$account_logged->getEMail().'</b> ) with recovery key! Recovery key not changed. Try again. Error:<br/>' . $mailer->ErrorInfo . '</p>';
|
$message = '<br /><p class="error">An error occorred while sending email ( <b>'.$account_logged->getEMail().'</b> ) with recovery key! Recovery key not changed. Try again later. For Admin: More info can be found in system/logs/mailer-error.log</p>';
|
||||||
|
|
||||||
$twig->display('success.html.twig', array(
|
$twig->display('success.html.twig', array(
|
||||||
'title' => 'Account Registered',
|
'title' => 'Account Registered',
|
||||||
|
@ -30,7 +30,7 @@ if ($preview) {
|
|||||||
$preview_done = _mail($account_logged->getCustomField('email'), $mail_subject, $mail_content);
|
$preview_done = _mail($account_logged->getCustomField('email'), $mail_subject, $mail_content);
|
||||||
|
|
||||||
if (!$preview_done)
|
if (!$preview_done)
|
||||||
error('Error while sending preview mail: ' . $mailer->ErrorInfo);
|
error('Error while sending preview mail. More info can be found in system/logs/mailer-error.log');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ foreach ($query as $email) {
|
|||||||
else {
|
else {
|
||||||
$failed++;
|
$failed++;
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
error('An error occorred while sending email to <b>' . $email['email'] . '</b>. Error: ' . $mailer->ErrorInfo);
|
error('An error occorred while sending email to <b>' . $email['email'] . '</b>. For Admin: More info can be found in system/logs/mailer-error.log');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,8 +217,7 @@ if($save)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
error('An error occorred while sending email! Account not created. Try again. Error:<br/>' . $mailer->ErrorInfo . '<br/>More info in system/logs/error.log');
|
error('An error occorred while sending email! Account not created. Try again. For Admin: More info can be found in system/logs/mailer-error.log');
|
||||||
log_append('error.log', '[createaccount.php] An error occorred while sending email: ' . $mailer->ErrorInfo . '. Error: ' . print_r(error_get_last(), true));
|
|
||||||
$new_account->delete();
|
$new_account->delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -263,8 +262,7 @@ if($save)
|
|||||||
if(_mail($email, 'Your account on ' . $config['lua']['serverName'], $mailBody))
|
if(_mail($email, 'Your account on ' . $config['lua']['serverName'], $mailBody))
|
||||||
echo '<br /><small>These informations were send on email address <b>' . $email . '</b>.';
|
echo '<br /><small>These informations were send on email address <b>' . $email . '</b>.';
|
||||||
else {
|
else {
|
||||||
error('An error occorred while sending email (<b>' . $email . '</b>)! Error:<br/>' . $mailer->ErrorInfo . '<br/>More info in system/logs/error.log');
|
error('An error occurred while sending email. For Admin: More info can be found in system/logs/mailer-error.log');
|
||||||
log_append('error.log', '[createaccount.php] An error occorred while sending email: ' . $mailer->ErrorInfo . '. Error: ' . print_r(error_get_last(), true));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ elseif($action == 'sendcode')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$account->setCustomField('email_next', (time() + 60));
|
$account->setCustomField('email_next', (time() + 60));
|
||||||
echo '<br /><p class="error">An error occorred while sending email! Try again or contact with admin. Error:<br/>' . $mailer->ErrorInfo . '</p>';
|
echo '<br /><p class="error">An error occorred while sending email! Try again later or contact with admin. For Admin: More info can be found in system/logs/mailer-error.log</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -330,7 +330,7 @@ elseif($action == 'step3')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo '<br /><p class="error">An error occorred while sending email! You will not receive e-mail with this informations. Error:<br/>' . $mailer->ErrorInfo . '</p>';
|
echo '<br /><p class="error">An error occorred while sending email! You will not receive e-mail with this informations. For Admin: More info can be found in system/logs/mailer-error.log</p>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -513,7 +513,7 @@ elseif($action == 'setnewpassword')
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
echo '<br /><p class="error">New password work! An error occorred while sending email! You will not receive e-mail with new password. Error:<br/>' . $mailer->ErrorInfo . '</p>';
|
echo '<br /><p class="error">New password work! An error occorred while sending email! You will not receive e-mail with new password. For Admin: More info can be found in system/logs/mailer-error.log;
|
||||||
}
|
}
|
||||||
echo '</TD></TR>
|
echo '</TD></TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user