Nodemailer
Nodemailer raises 535 5.7.8 EAUTH when the SMTP server rejects credentials. Supply the correct app password or OAuth2 token for your provider and port.
Updated Jul 1, 2026
The short answer
A 535 from Nodemailer is the SMTP server rejecting your AUTH command credentials (Nodemailer surfaces it as an EAUTH error wrapping "535 5.7.8 Authentication failed"). It almost always means a wrong username/password, a regular password used where an app password or OAuth2 token is required, or SMTP AUTH being disabled on the account. Fix it by supplying valid provider-specific credentials over the correct host and port.
Nodemailer raises this as an EAUTH error whose response contains the raw SMTP reply, typically 535 5.7.8 Authentication failed (or a provider variant like Gmail's 535 5.7.8 Username and Password not accepted or Microsoft 365's 535 5.7.139 Authentication unsuccessful). The error object also reports the command that failed — AUTH PLAIN, AUTH LOGIN, or AUTH XOAUTH2 — which tells you which auth method the server rejected.
535 is a permanent SMTP reply defined for the AUTH extension. Per RFC 4954, 535 5.7.8 means "Authentication credentials invalid" — "this response to the AUTH command indicates that the authentication failed due to invalid or insufficient authentication credentials." It is the server, not Nodemailer, rejecting you. Nodemailer's own error reference lists the common triggers behind an EAUTH:
command).Note this is distinct from connection-level failures (ECONNECTION, ETIMEDOUT) — a 535 means you reached the server and the login handshake itself was refused.
1. Confirm the credentials and transport are correct. Set host, port, and secure to match your provider, and pass the exact user/pass. Use secure: true with port 465 (implicit TLS) or secure: false with port 587 (STARTTLS) — both are valid per RFC 8314; neither port is deprecated.
const transporter = nodemailer.createTransport({host: "smtp.example.com",port: 587, // 587 = STARTTLS, or 465 with secure:truesecure: false,auth: {user: "you@example.com",pass: process.env.SMTP_PASSWORD, // keep secrets out of source},});// Verify the login before sendingawait transporter.verify();
transporter.verify() performs the auth handshake and surfaces a 535 immediately, so you can debug without sending a message.
2. Gmail / Google Workspace — use an App Password or OAuth2, NOT "less secure apps". Google removed the "Less Secure Apps" toggle in 2022, so that advice no longer works. With 2-Step Verification enabled, generate a 16-character App Password and use it as pass against smtp.gmail.com. For production, prefer OAuth2 with auth: { type: "OAuth2", ... }.
const transporter = nodemailer.createTransport({service: "gmail",auth: {user: "you@gmail.com",pass: process.env.GMAIL_APP_PASSWORD, // 16-char app password, no spaces},});
3. Microsoft 365 / Outlook — Basic auth is being retired. A 535 5.7.139 ... SmtpClientAuthentication is disabled means SMTP AUTH is off for the tenant or the mailbox. Microsoft is retiring Basic auth for SMTP AUTH Client Submission: under the timeline Microsoft revised in January 2026, Basic auth for SMTP AUTH stays available through 2026 and is disabled by default for existing tenants at the end of December 2026 (admins can re-enable), with new tenants created from January 2027 unable to use it and a final removal date to be announced in the second half of 2027. Either way the durable fix is to move to OAuth2 (XOAUTH2). If you still rely on Basic auth short-term, an admin must explicitly enable SMTP AUTH for the mailbox.
4. Other providers — use the right credential type. Zoho and many others require an app-specific password when 2FA is on. SendGrid expects the literal username apikey with your API key as the password. Always confirm the correct host/port for your account's region/data center in the provider's docs.
5. Stop disabling firewalls/antivirus for a 535. A firewall or AV product blocks the connection (producing a timeout, not a 535). Because 535 is an authentication rejection from the server, disabling security software will not fix it — focus on the credentials and auth method instead.
References
FAQ
Not usually. 535 is sent by the SMTP server rejecting your AUTH command, so the problem is the credentials or auth method, not your JavaScript. Nodemailer just wraps it as an EAUTH error. Run transporter.verify() to confirm the login handshake in isolation.
One API, every provider
Courier connects to your email, SMS, and push providers, handles retries and failover, and surfaces delivery errors in plain language.
Reply-code definitions per RFC 4954 §6 (535 5.7.8), extending the enhanced-status-code framework of RFC 3463. Last reviewed Jul 1, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.
© 2026 Courier. All rights reserved.