improve error handling on send, when invalid mailaddress is given

This commit is contained in:
Klaus Leithoff 2013-04-23 10:22:16 +00:00
parent 823e4c030e
commit fb0dc8d5be
2 changed files with 13 additions and 2 deletions

View File

@ -989,7 +989,18 @@
}
catch(phpmailerException $e) {
$this->errorInfo = $e->getMessage();
#error_log($this->errorInfo);
if ($mail->ErrorInfo) // use the complete mailer ErrorInfo, for full Information
{
if (stripos($mail->ErrorInfo, $this->errorInfo)===false)
{
$this->errorInfo = $mail->ErrorInfo.'<br>'.$this->errorInfo;
}
else
{
$this->errorInfo = $mail->ErrorInfo;
}
}
error_log(__METHOD__.__LINE__.array2string($this->errorInfo));
return false;
}
} else {

View File

@ -2035,7 +2035,7 @@ class PHPMailer {
$msg .= '<p>' . $this->Lang('smtp_error') . $lasterror['smtp_msg'] . "</p>\n";
}
}
$this->ErrorInfo = $msg;
if (empty($this->ErrorInfo) || strpos($this->ErrorInfo,$msg)===false) $this->ErrorInfo .= (empty($this->ErrorInfo)?'':'<br>').$msg;
}
/**