diff --git a/include/class.mailer.php b/include/class.mailer.php index f41d0e55a63ea814519aeac09b64749509029779..029051a9e67b9cf465d6cbe0596bf65418cf618b 100644 --- a/include/class.mailer.php +++ b/include/class.mailer.php @@ -513,7 +513,8 @@ class Mailer { // Force reconnect on next ->send() unset($smtp_connections[$key]); - $alert=sprintf(__("Unable to email via SMTP:%1\$s:%2\$d [%3\$s]\n\n%4\$s\n"), + $alert=_S("Unable to email via SMTP") + .sprintf(":%1\$s:%2\$d [%3\$s]\n\n%4\$s\n", $smtp['host'], $smtp['port'], $smtp['username'], $result->getMessage()); $this->logError($alert); } @@ -522,14 +523,21 @@ class Mailer { $mail = mail::factory('mail'); // Ensure the To: header is properly encoded. $to = $headers['To']; - return PEAR::isError($mail->send($to, $headers, $body))?false:$messageId; - + $result = $mail->send($to, $headers, $body); + if(!PEAR::isError($result)) + return $messageId; + + $alert=_S("Unable to email via php mail function") + .sprintf(":%1\$s\n\n%2\$s\n", + $to, $result->getMessage()); + $this->logError($alert); + return false; } function logError($error) { global $ost; //NOTE: Admin alert override - don't email when having email trouble! - $ost->logError(__('Mailer Error'), $error, false); + $ost->logError(_S('Mailer Error'), $error, false); } /******* Static functions ************/