move reset-call of smtp to phpmailer class, as it is the one that throws exceptions, and stops action

This commit is contained in:
Klaus Leithoff 2013-08-07 08:34:00 +00:00
parent d2a851931f
commit a7be5a026e
2 changed files with 3 additions and 2 deletions

View File

@ -774,6 +774,7 @@ class PHPMailer {
}
$smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
if(!$this->smtp->Mail($smtp_from)) {
$this->smtp->Reset();
throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL);
}
@ -818,9 +819,11 @@ class PHPMailer {
if (count($bad_rcpt) > 0 ) { //Create error message for any bad addresses
$badaddresses = implode(', ', $bad_rcpt);
$this->smtp->Reset();
throw new phpmailerException($this->Lang('recipients_failed') . $badaddresses);
}
if(!$this->smtp->Data($header . $body)) {
$this->smtp->Reset();
throw new phpmailerException($this->Lang('data_not_accepted'), self::STOP_CRITICAL);
}
if($this->SMTPKeepAlive == true) {

View File

@ -576,7 +576,6 @@ class SMTP {
}
if($code != 250) {
$this->Reset();
$this->error =
array("error" => "MAIL not accepted from server",
"smtp_code" => $code,
@ -672,7 +671,6 @@ class SMTP {
}
if($code != 250 && $code != 251) {
$this->Reset();
$this->error =
array("error" => "RCPT not accepted from server",
"smtp_code" => $code,