~ catch ErrorException ( when php.ini email config is invalid )

Signed-off-by: Christoph Potas <christoph286@googlemail.com>
This commit is contained in:
Christoph Potas 2018-08-30 16:18:54 +02:00
parent 368d3055b4
commit 8b87be12dc
No known key found for this signature in database
GPG Key ID: D4A4190F8260D7B0

View File

@ -1922,10 +1922,17 @@ class Email
$protocol = $this->getProtocol();
$method = 'sendWith'.ucfirst($protocol);
if (! $this->$method())
try
{
$failed = $this->$method();
} catch(\ErrorException $e)
{
$failed = true;
}
if ($failed)
{
$this->setErrorMessage(lang('email.sendFailure'.($protocol === 'mail' ? 'PHPMail' : ucfirst($protocol))));
return false;
}