Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

426
Views
NodeMailer - Username and Password not accepted

I am getting this in postman -

{
     "code": "EAUTH",
     "response": "535-5.7.8 Username and Password not accepted. Learn more at\n535 5.7.8  
                  https://support.google.com/mail/?p=BadCredentials x7- 
                  20020aa784c7000000b005058d220b37sm21945855pfn.64 - gsmtp",
     "responseCode": 535,
     "command": "AUTH PLAIN"
}

 

Email And password not accepted , I have already gone through this question, and tried possible way to resolve this problem, but nothing worked out.

nodemailer code section -

let transporter = nodemailer.createTransport({
   host: 'smtp.gmail.com',
   port: 587,
   secure: false,
   auth: {
     user: 'mygmail@gmail.com',
     pass: 'mypassword'
   }
})

const info = await transporter.sendMail({
       from: 'mygmail@gmail.com',
       to: "person@gmail.com",
       subject: "subject",
       text: "text",
       html: `<h1> hello </h1>`
})

I have tried -

  • generate an app-specific password and use that in place of your actual password.

  • enabled the captcha (link)

  • enabled the IMAP setting in gmail->setting->Forwarding and POP/IMAP

I Read this - less secure app and google account

Any help would be appreciated.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can not login to the smtp server using a login and password anymore. You could try using an apps password but as Less secure apps & your Google Account is being removed shortly this is probably not the best option.

enter image description here

I recommend looking into Xoauth2 this way you can authorize the user rather than relying upon their password. I would try adapting javascript-implicit-flow to see if this will work.

about 4 years ago · Juan Pablo Isaza Report

0

  • First, You need to use a valid Gmail account with your credentials.
  • You need to allow less secure apps from your google account to send emails. Through this link. Allow less secure apps From your Google Account

const nodemailer = require('nodemailer');

const sendEmail = async () => {
const transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
  user: 'sender gmail',
  pass: 'sender password',
  },
});

const options = {
from: 'sender gmail',
to: 'receiver gmail',
subject: 'subject',
text: 'text',
};

await transporter.sendMail(options);
}; 

module.exports = sendEmail;
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!