Skip to content Skip to sidebar Skip to footer

Nodemailer Invalid Login

I am new to node.js programming .I am using nodemailer module for sending emails. const nodemailer = require ('nodemailer'), credentials=require('./credentials.js'); var mailTransp

Solution 1:

One reason could be the 'modern security standard' protection from Gmail.

Check you gmail inbox for any new mail having subject "Google Account: sign-in attempt blocked"

If yes, open the mail and click on the link https://www.google.com/settings/security/lesssecureapps

set 'Access for less secure apps' to 'Turn on'. Try again, it should be working now.

Solution 2:

U need to Enable Security for Apps :

|*| If u r using gmail,

Use :service:'gmail',Goto :https://myaccount.google.com/lesssecureappsEnable :Allow less secure apps:ON

|*| If u r using yahoo,

Use :service:'yahoo',Goto :https://login.yahoo.com/account/securityEnable :Allowappsthatuselesssecuresignin

|*| If u r using Live or Hotmail, No need to enable anything.

Use :service:'hotmail',

Solution 3:

Particularly 2 issues: or you don't have enabled Less Secure Appshttps://myaccount.google.com/lesssecureapps or you don't have enabled Display Unlock Captchahttps://accounts.google.com/DisplayUnlockCaptcha, you need to turn on both of them.

Solution 4:

Did you double-check your login credentials? Also did you double-check your "from" adress to match your email?

I used the nodemailer for some tests 3 weeks ago with the gmail example given on the github page and it worked like a charm:

https://github.com/andris9/Nodemailer

Invalid login indicates mistyped/wrong credentials.

Solution 5:

In my case, turning on less secure apps only was not enough: https://myaccount.google.com/lesssecureapps

I had to enable display unlock captcha also: https://accounts.google.com/DisplayUnlockCaptcha

This solved my issue and i was able to send emails using nodemail and gmail.

This thing is not random actually nodemailer community site itself says to perform the second step to enable captcha, if turning on the less secure apps do not work alone. https://community.nodemailer.com/using-gmail/

enter image description here

Above image is taken from the nodemailer article link i have shared.

Post a Comment for "Nodemailer Invalid Login"