Skip to content

Commit

Permalink
SmtpMailer: $error may not be filled
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 18, 2018
1 parent fc65179 commit 13312eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Mail/SmtpMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected function connect()
$errno, $error, $this->timeout, STREAM_CLIENT_CONNECT, $this->context
);
if (!$this->connection) {
throw new SmtpException($error, $errno);
throw new SmtpException($error ?: error_get_last()['message'], $errno);
}
stream_set_timeout($this->connection, $this->timeout, 0);
$this->read(); // greeting
Expand Down

0 comments on commit 13312eb

Please sign in to comment.