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.
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 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
authobject missing or env var undefined- Wrong
secure/port combination
⚡ Quick fix
- Verify env vars are actually loaded (
console.log(!!process.env.SMTP_PASS)) - Use an app password or OAuth2
- Call
transporter.verify()to test config before sending
Detailed fix by platform
Node.js
await transporter.verify()throws the same error with a clearer failure before you send mail
How to diagnose
- Response — 535, 534 or 538?
- Env — Credentials loaded?
- 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:
Similar errors
- 530 5.7.0 Authentication Required SMTP: 530 5.7.0 Must issue a STARTTLS command first / 530 5.7.1 Authentication required
- 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
- 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
Most viewed in Email / SMTP
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 4 Nov 2026