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

查看:52
本文介绍了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

代码如下:

auth := smtp.PlainAuth("", "bjorkbjorksen@gmail.com", "PASSWORD", "smtp.gmail.com")
msg := "Subject: Hello

World!"
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天全站免登陆