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

**Code:** `Nodemailer: EAUTH Invalid login` · **Category:** Email / SMTP · **Seen on:** SMTP, Node.js

The SMTP server rejected the credentials passed to Nodemailer.

## 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?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/email/nodemailer-eauth-invalid-login)
