Skip to content

Commit

Permalink
Fix error messages if PHP's mail() function fails
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusBauer committed Jan 17, 2017
1 parent 541fb03 commit 9b13381
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Network/Email/MailTransport.php
Expand Up @@ -72,12 +72,12 @@ protected function _mail($to, $subject, $message, $headers, $params = null) {
//@codingStandardsIgnoreStart
if (!@mail($to, $subject, $message, $headers)) {
$error = error_get_last();
$msg = 'Could not send email: ' . isset($error['message']) ? $error['message'] : 'unknown';
$msg = 'Could not send email: ' . (isset($error['message']) ? $error['message'] : 'unknown');
throw new SocketException($msg);
}
} elseif (!@mail($to, $subject, $message, $headers, $params)) {
$error = error_get_last();
$msg = 'Could not send email: ' . isset($error['message']) ? $error['message'] : 'unknown';
$msg = 'Could not send email: ' . (isset($error['message']) ? $error['message'] : 'unknown');
//@codingStandardsIgnoreEnd
throw new SocketException($msg);
}
Expand Down

0 comments on commit 9b13381

Please sign in to comment.