From 8512a4d03f6288d8e0714f83b53b4405bd8dbebb Mon Sep 17 00:00:00 2001 From: Alex Gusev Date: Thu, 27 Jun 2019 17:08:04 +0300 Subject: [PATCH] Update Sendmail.php `error_get_last()` usage instead of error handler replacement. --- src/Transport/Sendmail.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Transport/Sendmail.php b/src/Transport/Sendmail.php index 821c94e3..3137eb7e 100644 --- a/src/Transport/Sendmail.php +++ b/src/Transport/Sendmail.php @@ -289,16 +289,14 @@ protected function prepareParameters(Mail\Message $message) */ public function mailHandler($to, $subject, $message, $headers, $parameters) { - set_error_handler([$this, 'handleMailErrors']); if ($parameters === null) { $result = mail($to, $subject, $message, $headers); } else { $result = mail($to, $subject, $message, $headers, $parameters); } - restore_error_handler(); - if ($this->errstr !== null || ! $result) { - $errstr = $this->errstr; + if (!$result) { + $errstr = error_get_last()['message']; if (empty($errstr)) { $errstr = 'Unknown error'; }