Gmail:530 5.5.1需要验证。了解更多信息 [英] Gmail: 530 5.5.1 Authentication Required. Learn more at

查看:131
本文介绍了Gmail:530 5.5.1需要验证。了解更多信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个Go程序成功地从我的家用电脑发送电子邮件,但DigitalOcean上的虚拟服务器上收到以下错误:

This Go program successfully sends email from my home computer, but on a virtual server on DigitalOcean receives the following error:

panic: 530 5.5.1 Authentication Required. Learn more at

以下是代码:

Here's the code:

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


推荐答案

Gmail帐户的安全设置,并将不太安全的应用设置为启用
为我工作。

Get to your Gmail account's security settings and set permissions for "Less secure apps" to Enabled. Worked for me.

这篇关于Gmail:530 5.5.1需要验证。了解更多信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆