Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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

1 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...