Catch exceptions from PHPMailer

This commit is contained in:
Michael Gapczynski 2012-07-11 15:36:27 -04:00
parent ebcf5bce3c
commit e887fd7ba8
1 changed files with 28 additions and 26 deletions

View File

@ -56,6 +56,7 @@ class OC_Mail {
$mailo->From =$fromaddress;
$mailo->FromName = $fromname;;
$a=explode(' ',$toaddress);
try {
foreach($a as $ad) {
$mailo->AddAddress($ad,$toname);
}
@ -80,9 +81,10 @@ class OC_Mail {
$mailo->Send();
unset($mailo);
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);
}
}