From 4bc4952440f7c19737cd5946fc8e95d14bc7e222 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Fri, 11 Jan 2019 18:19:43 +0800 Subject: [PATCH] debug --- extend/phpmailer/PHPMailer.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extend/phpmailer/PHPMailer.php b/extend/phpmailer/PHPMailer.php index 0d38879bc..accf9ac52 100644 --- a/extend/phpmailer/PHPMailer.php +++ b/extend/phpmailer/PHPMailer.php @@ -1770,9 +1770,10 @@ class PHPMailer */ protected function smtpSend($header, $body) { + try { $bad_rcpt = []; if (!$this->smtpConnect($this->SMTPOptions)) { - throw new \Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); + throw new Exception($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); } //Sender already validated in preSend() if ('' == $this->Sender) { @@ -1841,6 +1842,12 @@ class PHPMailer } return true; + } catch (Exception $exc) { + $lastexception = $exc; + $this->edebug($exc->getMessage()); + // We must have connected, but then failed TLS or Auth, so close connection nicely + $this->smtp->quit(); + } } /**