Gmail:530 5.5.1 需要身份验证。了解更多信息,请访问

2023-11-29

此 Go 程序成功从我的家庭计算机发送电子邮件,但在 DigitalOcean 上的虚拟服务器上收到以下错误:

panic: 530 5.5.1 Authentication Required. Learn more at

这是代码:

auth := smtp.PlainAuth("", "[email protected]", "PASSWORD", "smtp.gmail.com")
msg := "Subject: Hello\r\n\r\nWorld!"
e = smtp.SendMail("smtp.gmail.com:587", auth, "[email protected]", []string{email}, []byte(msg))
if e != nil { panic(e) }

进入 Gmail 帐户的安全设置并设置“安全性较低的应用程序" to Enabled。 为我工作。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Gmail:530 5.5.1 需要身份验证。了解更多信息,请访问 的相关文章

随机推荐