diff --git a/include/class.mailer.php b/include/class.mailer.php index a752d4043f062c83b9388a09a1f12824bd74dd57..799bcd4cf34966efab3066be287512faab49cb97 100644 --- a/include/class.mailer.php +++ b/include/class.mailer.php @@ -523,8 +523,14 @@ 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=sprintf(__("Unable to email via php mail function:%1\$s\n\n%2\$s\n"), + $to, $result->getMessage()); + $this->logError($alert); + return false; } function logError($error) {