muquit / mailsend

A program to send mail via SMTP from command line
Other
294 stars 68 forks source link

Gmail constantly fails - Error: AUTH failed #91

Open methodops opened 8 years ago

methodops commented 8 years ago

I am trying this:

mailsend1.18.exe -to "receiver@gmail.com" -from "myusername@gmail.com" -ssl -port "465" -auth -smtp "smtp.gmail.com " -sub test +cc +bc -v -user "myusername@gmail.com" -pass "mypassword"

Getting error: Error: AUTH LOGIN failed: '534 5.7.14

I also tried with -auth-plain and -auth-login. Similar error with AUTH failed.

My gmail account is not set for 2-factor authentication, password is correct. I also looked into all examples on wiki for SSL on gmail, tried many options but always AUTH failed.

Any ideas?

muquit commented 8 years ago

I just tested mailsend v1.18 from windows, mac and linux with -ssl -port 465 and -starttls -port 587, works fine. Make sure you can login to the -user account from a browser. Also if the password has any non-ascii characters in it, the input does not work in Windows.. this is the only problem I can think of. Thanks.

methodops commented 8 years ago

Solved. I had to enable "Less secure apps" (turn it ON). You can find it on your account here: http://www.google.com/settings/security/lesssecureapps

Some more reading why this is needed: https://support.google.com/accounts/answer/6010255?hl=en

Hope this will help other people with the same issue.

muquit commented 8 years ago

I did not know about that option of gmail smtp. Thanks for figuring it out.

p1r473 commented 8 years ago

Hi, I have 2factor authentication turned off. So, I am not able to do less secure apps. I am doing: mailsend1.18 -t recipient@email.com -f sender@gmail.com -ssl -port 465 -auth -smtp smtp.gmail.com -sub subject -M message -user sender@gmail.com -pass YourGmailPassword I am getting the error: Error: AUTH LOGIN failed: '535 5.7.8 Username and Password not accepted. Learn more at' Could not send mail

ways2web commented 7 years ago

you need an app-passwort for third party apps like mailsend.. not your own standard password. https://security.google.com/settings/security/apppasswords