Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

427
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda