Skip to content

Commit

Permalink
Delay throwing of bad recipients exception, fixes PHPMailer#139
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Nov 14, 2013
1 parent 999438b commit 40307c9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions class.phpmailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,6 @@ protected function smtpSend($header, $body)
$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);
}
Expand All @@ -1230,6 +1227,12 @@ protected function smtpSend($header, $body)
$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;
}

Expand Down

0 comments on commit 40307c9

Please sign in to comment.