Nodemailer: EAUTH Invalid login Email / SMTP Origin: Network Last updated 4 Nov 2026

Nodemailer: Error: Invalid login: 535-5.7.8 Username and Password not accepted (code: 'EAUTH', responseCode: 535)

The SMTP server rejected the credentials passed to Nodemailer.

Exact message you may see Error: Invalid login: 535-5.7.8 Username and Password not acceptedNodemailer EAUTH Invalid logincode: 'EAUTH', responseCode: 535Error: Invalid login: 534-5.7.9 Application-specific password requiredInvalid login: 535 Authentication failed
Seen on: SMTP Node.js

Meaning

EAUTH includes the server's response, such as 535 (bad credentials), 534 (app password required) or 538 (TLS required). Check username, password, secure flag, and that the account allows SMTP. Do not commit credentials; read them from environment variables.

Common causes

  • Wrong credentials or an expired app password
  • Account password used with 2-Step Verification on
  • Sign-in blocked by the provider
  • auth object missing or env var undefined
  • Wrong secure/port combination

⚡ Quick fix

  1. Verify env vars are actually loaded (console.log(!!process.env.SMTP_PASS))
  2. Use an app password or OAuth2
  3. Call transporter.verify() to test config before sending

Detailed fix by platform

Node.js

  1. await transporter.verify() throws the same error with a clearer failure before you send mail

How to diagnose

  1. Response — 535, 534 or 538?
  2. Env — Credentials loaded?
  3. 2FA — App password in use?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Network. Errors that are often confused with or caused by this one (click to open):

530 5.7.0 Authentication Required — SMTP: 530 5.7.0 Must issue a STARTTLS command first / 530 5.7.1 Authentication required (Email / SMTP)530 5.7.0 Authenticat…534 5.7.9 Application-specific password required — SMTP: 534-5.7.9 Application-specific password required. Learn more at https://support.google.com/accounts/answer/185833 (Email / SMTP)534 5.7.9 Application…535 5.7.8 Username and Password not accepted — SMTP: 535-5.7.8 Username and Password not accepted. Learn more at https://support.google.com/mail/?p=BadCredentials (Email / SMTP)535 5.7.8 Username an…Nodemailer: ETIMEDOUT / ECONNECTION — Nodemailer: Error: connect ETIMEDOUT 142.250.27.108:465 (code: 'ETIMEDOUT', command: 'CONN') (Email / SMTP)Nodemailer: ETIMEDOUT…Nodemailer: Greeting never received — Nodemailer: Error: Greeting never received (code: 'ETIMEDOUT', command: 'CONN') (Email / SMTP)Nodemailer: Greeting …Postfix: SASL authentication failed — Postfix: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory (Email / SMTP)Postfix: SASL authent…self-signed certificate (SMTP TLS) — Nodemailer: Error: self signed certificate in certificate chain (code: 'ESOCKET') / unable to verify the first certificate (Email / SMTP)self-signed certifica…SMTPAuthenticationError (Python) — Python: smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted') (Email / SMTP)SMTPAuthenticationErr…Nodemaile…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.