Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{ Error: Invalid login: 535 5.7.3 Authentication unsuccessful} #953

Closed
Meenakshi14 opened this issue Nov 1, 2018 · 14 comments
Closed

{ Error: Invalid login: 535 5.7.3 Authentication unsuccessful} #953

Meenakshi14 opened this issue Nov 1, 2018 · 14 comments

Comments

@Meenakshi14
Copy link

Hi,

I am trying to send email through nodejs using nodemailer module, I am using the following piece of code to send email:

var transporter = nodemailer.createTransport({
    host: 'smtp.mycompany.com',
    port: 587,
    secure: false,
    auth: {
        user: "user@mycompany.com",
        pass: "mypassword"
    }
});

var mailOptions = {
from: 'user@mycompany.com',
to: 'abc@gmail.com',
subject: "Test",
text: '',
html: ''
};
// send mail with defined transport object
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.log(error);
}
console.log("info > ",info);

    });

the same code was working perfectly in last 7 to 8 months but recently I started receiving following error:
{ Error: Invalid login: 535 5.7.3 Authentication unsuccessful
at SMTPConnection._formatError (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:606:19)
at SMTPConnection._actionAUTHComplete (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:1335:34)
at SMTPConnection._responseActions.push.str (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:1293:18)
at SMTPConnection._processResponse (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:762:20)
at SMTPConnection._onData (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:558:14)
at TLSSocket._socket.on.chunk (/var/task/node_modules/nodemailer/lib/smtp-connection/index.js:709:51)
at emitOne (events.js:96:13)
at TLSSocket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at TLSSocket.Readable.push (_stream_readable.js:134:10)
code: 'EAUTH',
response: '535 5.7.3 Authentication unsuccessful',
responseCode: 535,
command: 'AUTH LOGIN' }

I have checked that credentials are correct and we have not made any changes. It was working since last 8 months perfectly.

@kishoreaoe
Copy link

@Meenakshi14 , I have also faced the same issue. I have contacted my MS team and confirmed that for sending email via our company smtp mail server they are not expecting any credentials. (means say our company email is test@company.com, to send email via using this no need add "auth" object.)
After removing the auth object it worked perfectly fine for me.!

Thanks and Regards,
Kishore Kumar. K

@puXiaoyi
Copy link

puXiaoyi commented Nov 8, 2018

I have also faced the same issue. I am from china. I used tencent smtp.qq.com. I applied the auth code and sent mail successfully. But ... it failed last two days. why?

@kishoreaoe
Copy link

@puXiaoyi, What is the error you are facing. Please enable debug and post the log.

@andris9
Copy link
Member

andris9 commented Nov 19, 2018

Check your credentials, some hosts require additional validation before you can use SMTP

@andris9 andris9 closed this as completed Nov 19, 2018
@ChangerHe
Copy link

I have also faced the same issue. I am from china. I used tencent smtp.qq.com. I applied the auth code and sent mail successfully. But ... it failed last two days. why?

maybe you need take a authorization code from QQ mail

@Muhammad-Hassan-1211
Copy link

Unhandled error for request POST /api/rusers: Error: Invalid login: 535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8 https://support.google.com/mail/?p=BadCredentials l19sm4586061wrg.29 - gsmtp

@tiavina-mika
Copy link

I have also faced the same issue, so anyone has find the solution?

@martiiian
Copy link

if you're using google then generate app password, and replace current account password in .env to generated app password

@Josse3
Copy link

Josse3 commented Oct 7, 2019

Check your credentials, some hosts require additional validation before you can use SMTP

Is it possible that they do not require these on localhost and only on the domain? Because on localhost it works fine and I get this error thrown on my server.

@octipus
Copy link

octipus commented Mar 5, 2020

Check your credentials, some hosts require additional validation before you can use SMTP

Is it possible that they do not require these on localhost and only on the domain? Because on localhost it works fine and I get this error thrown on my server.

For some reason i get the same problem and cannot find any solution to this. Anyone?

@MatheusLealAquino
Copy link

I had this issue and the problem was the 2AF activated at the account.

@druskacik
Copy link

I had the same problem and the issue was this:

I was using credentials provided by my hosting provider. The default setting was that the credentials were secured with GEO security, meaning the credentials wouldn't work outside my country. I was deploying on Heroku whose servers are abroad. That's why I could send emails from localhost but not from deployed app.

After I disabled the GEO security everything worked as it should.

@CarlosAzpurua
Copy link

Tuve el mismo problema y el problema fue este:

Estaba usando las credenciales proporcionadas por mi proveedor de alojamiento. La configuración predeterminada era que las credenciales estaban protegidas con seguridad GEO, lo que significa que las credenciales no funcionarían fuera de mi país. Estaba implementando en Heroku cuyos servidores están en el extranjero. Es por eso que podría enviar correos electrónicos desde localhost pero no desde la aplicación implementada.

Después de que desactivé la seguridad de GEO, todo funcionó como debería.

MAN como desactivaste la seguridad Geo de heroku ? tengo ese problema estoy seguro

@MWaris97
Copy link

@Meenakshi14 , I have also faced the same issue. I have contacted my MS team and confirmed that for sending email via our company smtp mail server they are not expecting any credentials. (means say our company email is test@company.com, to send email via using this no need add "auth" object.) After removing the auth object it worked perfectly fine for me.!

Thanks and Regards, Kishore Kumar. K

Thanks a lot Kishore, your comment saved me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests