Catch exceptions from PHPMailer
This commit is contained in:
parent
7077678f7f
commit
66da0a2151
|
@ -56,6 +56,7 @@ class OC_Mail {
|
||||||
$mailo->From =$fromaddress;
|
$mailo->From =$fromaddress;
|
||||||
$mailo->FromName = $fromname;;
|
$mailo->FromName = $fromname;;
|
||||||
$a=explode(' ',$toaddress);
|
$a=explode(' ',$toaddress);
|
||||||
|
try {
|
||||||
foreach($a as $ad) {
|
foreach($a as $ad) {
|
||||||
$mailo->AddAddress($ad,$toname);
|
$mailo->AddAddress($ad,$toname);
|
||||||
}
|
}
|
||||||
|
@ -80,9 +81,10 @@ class OC_Mail {
|
||||||
|
|
||||||
$mailo->Send();
|
$mailo->Send();
|
||||||
unset($mailo);
|
unset($mailo);
|
||||||
|
|
||||||
OC_Log::write('Mail from '.$fromname.' ('.$fromaddress.')'.' to: '.$toname.'('.$toaddress.')'.' subject: '.$subject,'mail',OC_Log::DEBUG);
|
OC_Log::write('Mail from '.$fromname.' ('.$fromaddress.')'.' to: '.$toname.'('.$toaddress.')'.' subject: '.$subject,'mail',OC_Log::DEBUG);
|
||||||
|
} catch (Exception $exception) {
|
||||||
|
OC_Log::write('mail', $exception->getMessage(), OC_Log::DEBUG);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue