Skip to content
Snippets Groups Projects
Commit e887fd7b authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Catch exceptions from PHPMailer

parent ebcf5bce
Branches
No related tags found
No related merge requests found
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment