Gmail: 530 5.5.1 Authentication Required. Find out more at

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

panic: 530 5.5.1 Authentication Required. Learn more at 

Here is 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) } 
+29
go smtp gmail smtp-auth
Jun 21 '13 at 4:06 on
source share
4 answers

Get the security settings for your Gmail account and set the permissions for the Less Secure Apps to Enabled . Worked for me.

+32
Jul 24 '14 at 13:31
source share

Derp! I signed up for this account and the warning message “Suspicious login” appeared at the top of the page. After clicking on the warning and authorizing access, everything works.

+11
Jun 21 '13 at 4:19
source share

You need to go here https://security.google.com/settings/security/apppasswords

then select Gmail and then select the device. then click "Create." Just copy and paste the password that Google creates.

+6
Mar 17 '15 at 18:54
source share

You need to enable POP and IMAP mail in the email settings that you use to send mail. Good luck

0
Mar 16 '14 at 20:24
source share



All Articles