mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
~ catch ErrorException ( when php.ini email config is invalid )
Signed-off-by: Christoph Potas <christoph286@googlemail.com>
This commit is contained in:
parent
368d3055b4
commit
8b87be12dc
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user