Php SMTP通知:检查是否连接时捕获EOF

Php SMTP通知:检查是否连接时捕获EOF,php,mysql,phpmailer,Php,Mysql,Phpmailer,我把端口改为465到587,但它不工作。我搜索了这个确切的问题,但大多数情况下,答案是端口更改为465,但不起作用。我在代码中做错了什么。很抱歉,我是初学者请尝试添加此项。这为我解决了问题 2020-05-06 07:59:56 SERVER -> CLIENT: 2020-05-06 07:59:56 SMTP NOTICE: EOF caught while checking if connected SMTP Error: Could not authenticate. SMTP E

我把端口改为465到587,但它不工作。我搜索了这个确切的问题,但大多数情况下,答案是端口更改为465,但不起作用。我在代码中做错了什么。很抱歉,我是初学者

请尝试添加此项。这为我解决了问题

2020-05-06 07:59:56 SERVER -> CLIENT:
2020-05-06 07:59:56 SMTP NOTICE: EOF caught while checking if connected
SMTP Error: Could not authenticate.
SMTP Error: Could not authenticate.
Message could not be sent. Mailer Error: SMTP Error: Could not authenticate.
确保没有打开两步验证


值得注意的是,某些SMTP服务器会阻止连接。一些SMTP服务器不支持SSL(或TLS)连接。

2020-05-06 08:32:18服务器->客户端:220 SMTP.gmail.com ESMTP r78sm1134798pgr.40-gsmtp 2020-05-06 08:32:18客户端->服务器:EHLO本地主机2020-05-06 08:32:18服务器->客户端:250-SMTP.gmail.com为您服务,[2001:4450:832b:8a00:7849:794b:53f9:687]250-SIZE 35882577250-8BITMIME250-AUTH登录普通XOAUTH2普通客户端Token OAUTHBEARER XOAUTH250-ENHANCEDSTATUSCODES250-Pipeling250-CHUNKING250 SMTPUTF8请看一看:这是正确答案,输出是调试反馈(可以关闭),不是错误。
2020-05-06 07:59:56 SERVER -> CLIENT:
2020-05-06 07:59:56 SMTP NOTICE: EOF caught while checking if connected
SMTP Error: Could not authenticate.
SMTP Error: Could not authenticate.
Message could not be sent. Mailer Error: SMTP Error: Could not authenticate.
$mail->SMTPSecure = 'ssl';