Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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("", "[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) } 
like image 693
Calder Avatar asked Jun 21 '13 04:06

Calder


People also ask

How do I fix 530 authentication required?

There's two ways to solve this problem. Either configure your email client to use SMTP authentication. This setting is normally found in the account settings in your email client. Or, disable SMTP authentication for the IP range.

How do you fix 535 5.7 8 username and password not accepted?

If getting "Username and Password not accepted" 535 5.7. 8 error, but user name and password work logging onto email via web (with 2-factor authentication), you may need to enable "Access for less secure apps" (allow exceptions to 2-factor authentication) in your email settings.


1 Answers

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

like image 79
MichaelZi Avatar answered Sep 21 '22 17:09

MichaelZi