为什么 Google SMTP 服务器不再工作?

Why do Google SMTP server not work anymore?

我已经使用 Google SMTP 服务器多年从我的网页发送邮件,但它不再工作了。我的 PHPMailer 脚本中的任何内容都没有更改。

 $mail->Host = "ssl://smtp.gmail.com";
 $mail->Port = 465;
 $mail->SMTPAuth = true;

我收到以下错误。

 SMTP Error: Could not authenticate. 

这Google有什么变化吗?

Google 破坏 SMTP 身份验证的历史由来已久。设置 $mail->SMTPDebug = 2 并阅读 SMTP 抄本,这将为您提供一些线索。然后阅读 the PHPMailer troubleshooting guide 关于这个主题有很多话要说。

我在 google 安全设置中允许安全性较低的应用程序,现在它又能正常工作了。