Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
552 views
in Technique[技术] by (71.8m points)

smtp - Gmail: 530 5.5.1 Authentication Required. Learn more at

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

World!"
e = smtp.SendMail("smtp.gmail.com:587", auth, "bjorkbjorksen@gmail.com", []string{email}, []byte(msg))
if e != nil { panic(e) }
question from:https://stackoverflow.com/questions/17227532/gmail-530-5-5-1-authentication-required-learn-more-at

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...