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

Invalid login: 535-5.7.8 Username and Password not accepted #1656

Open
hypo-thesis opened this issue May 16, 2024 · 3 comments
Open

Invalid login: 535-5.7.8 Username and Password not accepted #1656

hypo-thesis opened this issue May 16, 2024 · 3 comments

Comments

@hypo-thesis
Copy link

I am trying to send some email using Google app password that I generated from my google account and the following code :

const transporter = nodemailer.createTransport({
  pool: true,
  host: 'smtp.gmail.com',
  priority: 'high',
  from: {
    name: 'my name',
    address: '[email protected]'
  },
  port: 587,
  secure: false,
  auth: {
    user: "[email protected]",
    pass: "kbpzbvrkrrqvjwfb", // also tried with spaces
  },
  tls: {
    rejectUnauthorized: false
  }
});

Which I run into :

Error: Invalid login: 535-5.7.8 Username and Password not accepted. For more information, go to
535 5.7.8  https://support.google.com/mail/?p=BadCredentials 2adb3069b0e04-521f38d7f71sm2899713e87.194 - gsmtp

Everything had been working for the past 6 months but suddenly today I can not longer access it. I did generate a new key which didn't change anything.

@diegocamy
Copy link

diegocamy commented May 16, 2024

having the same issue right now, it was working fine until it stopped

EDIT: nevermind, generated a new password and it worked, it seems obvious but have you tried that? also, your credentials are ok? Have you checked for typos?

@hypo-thesis
Copy link
Author

hypo-thesis commented May 17, 2024

having the same issue right now, it was working fine until it stopped

EDIT: nevermind, generated a new password and it worked, it seems obvious but have you tried that? also, your credentials are ok? Have you checked for typos?

I tried it, it doesn't work. Thought Google has blocked my server IP. I contacted them since I have a business account. Their reps are really uneducated and told me everything was alright from their end. I changed my server with the same set up and codes. The new server goes through but the old one still gives me the password error. I am at a loss for words. I don't know whether Google is causing this or somehow Nodemailer is not sending the credentials correctly.

@shivam30072
Copy link

i am having the same issue, my code works perfectly in my local system but does not work on my server i have deployed it on aws ec2 below is my code

const nodemailer = require("nodemailer");
const fs = require("fs");
const path = require("path");
const handlebars = require("handlebars");

const transporter = nodemailer.createTransport({
service: "gmail",
// host: "smtp.gmail.com",
// port: 587,
// secure: false,
// logger: true,
debug: true,
port: 465,
secure: true, // Use true for port 465, false for all other ports
secureConnection: false,
auth: {
user: process.env.USER ||
pass: process.env.APP_PASSWORD ||
},
tls: {
rejectUnauthorized: false, // This will ignore the self-signed certificate error
},
});

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

3 participants