Skip to content
Permalink
Browse files

wrapped the email sending in an exception handler

  • Loading branch information...
caseysoftware committed Aug 3, 2014
1 parent 0af87c6 commit 5de3c47608ed43f308fb69906a66ef5f7f191342
Showing with 11 additions and 8 deletions.
  1. +9 −6 classes/w2p/Utilities/Mail.class.php
  2. +2 −2 lib/PHPMailer/class.phpmailer.php
@@ -275,10 +275,14 @@ public function Priority($priority = 5)
*/
public function Send()
{
if ($this->defer) {
return $this->QueueMail();
} else {
return PHPMailer::Send();
try {
if ($this->defer) {
return $this->QueueMail();
} else {
return PHPMailer::Send();
}
} catch (Exception $exc) {
error_log($exc->getMessage());
}
}
@@ -406,8 +410,7 @@ public function CheckAddresses($aad)
{
foreach ($aad as $ad) {
if (!$this->ValidEmail($ad)) {
echo 'Class Mail, method Mail : invalid address ' . $ad;
exit;
return false;
}
}
return true;
@@ -461,7 +461,7 @@ private function AddAnAddress($kind, $address, $name = '') {
if ($this->exceptions) {
throw new phpmailerException($this->Lang('invalid_address').': '.$address);
}
echo $this->Lang('invalid_address').': '.$address;
//echo $this->Lang('invalid_address').': '.$address;
return false;
}
if ($kind != 'ReplyTo') {
@@ -583,7 +583,7 @@ public function Send() {
if ($this->exceptions) {
throw $e;
}
echo $e->getMessage()."\n";
//echo $e->getMessage()."\n";
return false;
}
}

0 comments on commit 5de3c47

Please sign in to comment.
You can’t perform that action at this time.