Revision 87d9798f
Added by Jim Pingle over 4 years ago
src/etc/inc/notices.inc | ||
---|---|---|
422 | 422 |
"Date" => date("r") |
423 | 423 |
); |
424 | 424 |
|
425 |
$smtp =& Mail::factory('smtp', $params); |
|
426 |
$mail = $smtp->send($to, $headers, $message); |
|
425 |
$error_text = 'Could not send the message to %1$s -- Error: %2$s'; |
|
426 |
try { |
|
427 |
$smtp =& Mail::factory('smtp', $params); |
|
428 |
$mail = @$smtp->send($to, $headers, $message); |
|
429 |
|
|
430 |
if (PEAR::isError($mail)) { |
|
431 |
$err_msg = sprintf(gettext($error_text), |
|
432 |
$to, $mail->getMessage()); |
|
433 |
} |
|
434 |
} catch (Exception $e) { |
|
435 |
$err_msg = sprintf(gettext($error_text), $to, $e->getMessage()); |
|
436 |
} |
|
427 | 437 |
|
428 |
if (PEAR::isError($mail)) { |
|
429 |
$err_msg = sprintf(gettext( |
|
430 |
'Could not send the message to %1$s -- Error: %2$s'), |
|
431 |
$to, $mail->getMessage()); |
|
438 |
if (!empty($err_msg)) { |
|
432 | 439 |
log_error($err_msg); |
433 | 440 |
return($err_msg); |
434 | 441 |
} |
Also available in: Unified diff
Improve handling of SMTP send errors. Fixes #11063