mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix error messages if PHP's mail() function fails
This commit is contained in:
parent
541fb03438
commit
9b13381b0a
1 changed files with 2 additions and 2 deletions
|
@ -72,12 +72,12 @@ class MailTransport extends AbstractTransport {
|
||||||
//@codingStandardsIgnoreStart
|
//@codingStandardsIgnoreStart
|
||||||
if (!@mail($to, $subject, $message, $headers)) {
|
if (!@mail($to, $subject, $message, $headers)) {
|
||||||
$error = error_get_last();
|
$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);
|
throw new SocketException($msg);
|
||||||
}
|
}
|
||||||
} elseif (!@mail($to, $subject, $message, $headers, $params)) {
|
} elseif (!@mail($to, $subject, $message, $headers, $params)) {
|
||||||
$error = error_get_last();
|
$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
|
//@codingStandardsIgnoreEnd
|
||||||
throw new SocketException($msg);
|
throw new SocketException($msg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue