Delay throwing of bad recipients exception, fixes #139

This commit is contained in:
Synchro 2013-11-14 12:15:57 +01:00
parent 999438bca2
commit 40307c91dc
1 changed files with 6 additions and 3 deletions

View File

@ -1218,9 +1218,6 @@ class PHPMailer
$this->doCallback($isSent, '', '', $bcc[0], $this->Subject, $body, $this->From);
}
if (count($bad_rcpt) > 0) { //Create error message for any bad addresses
throw new phpmailerException($this->lang('recipients_failed') . implode(', ', $bad_rcpt));
}
if (!$this->smtp->data($header . $body)) {
throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL);
}
@ -1230,6 +1227,12 @@ class PHPMailer
$this->smtp->quit();
$this->smtp->close();
}
if (count($bad_rcpt) > 0) { //Create error message for any bad addresses
throw new phpmailerException(
$this->lang('recipients_failed') . implode(', ', $bad_rcpt),
self::STOP_CONTINUE
);
}
return true;
}