Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nodemailer throws error Invalid login: 534-5.7.14

I found this error while i'm trying to send an email from one Gmail account to another. How to solve this error ? Help me on it.

There were an error:

Invalid login: 534-5.7.14 Please log in via 534-5.7.14 your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/answer/78754 a90-v6sm7292588pfg.106 - gsmtp

I have already try Allow less secure apps to be ON but still same error. it working correctly when i run application on local machine but this error on server machine

Please help me

like image 368
sways Avatar asked Aug 23 '18 07:08

sways


2 Answers

You might need to allow access to your Gmail account.

https://accounts.google.com/b/0/DisplayUnlockCaptcha

Edit (after your comment)

// create reusable transporter object using the default SMTP transport

transporter = nodemailer.createTransport({     host: 'smtp.gmail.com',     port: 465,     secure: true,      auth: {         user: 'yourEmail',          pass: 'yourPassword'      } }); 

your 'nodemailer.createTransport' should look something similar.

like image 179
Shanil Arjuna Avatar answered Sep 21 '22 05:09

Shanil Arjuna


If you use GMAIL service as a transporter,

Step-1: Log in to your gmail account.

Step-2: Enable less secure app access and/or DisplayUnlockCaptcha on your gmail account.

Step-3: Follow a 6-step guide on Sign in with App Passwords

Step-4: Replace your transporter password with the 16-character generated app password you obtain from Step-3 above.

These four easy steps solved my problem.

like image 34
Pelesi Pelesi Avatar answered Sep 21 '22 05:09

Pelesi Pelesi