0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 01:52:15 +02:00

Trap low-level SMTP errors, see #1012

This commit is contained in:
Marcus Bointon 2017-03-23 12:37:23 +01:00
parent 863e531de8
commit 799ff351ca
No known key found for this signature in database
GPG Key ID: DE31CD6EB646AA24
2 changed files with 5 additions and 1 deletions

View File

@ -45,6 +45,7 @@ This is a major update that breaks backwards compatibility.
* Simplification of address validation - now uses PHP's `FILTER_VALIDATE_EMAIL` pattern by default, retains advanced options
* `Debugoutput` can accept a PSR-3 logger instance
* To reduce code footprint, the examples folder is no longer included in composer deployments or github zip files
* Trap low-level errors in SMTP, reports via debug output
## Version 5.2.23 (March 15th 2017)
* Improve trapping of TLS errors during connection so that they don't cause warnings, and are reported better in debug output

View File

@ -959,7 +959,10 @@ class SMTP
public function client_send($data)
{
$this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT);
return fwrite($this->smtp_conn, $data);
set_error_handler(array($this, 'errorHandler'));
$result = fwrite($this->smtp_conn, $data);
restore_error_handler();
return $result;
}
/**