535

SMTP Error 535: Authentication Failed

Permanent failure High severity Authentication RFC 4954
What it means

SMTP Error 535 means “Authentication Failed.” SMTP AUTH was attempted and rejected. The username or password is wrong, expired, or not permitted for this connection. It is the single most common error when an application first tries to send.

At a glance
Code535
Bounce typeHard (permanent)
SeverityHigh
CategoryAuthentication
What to doSuppress the address; do not retry
StandardRFC 4954
What it looks like in your mail logs
535 5.7.139 Authentication unsuccessful, SMTP AUTH is disabled for the mailbox

What does 535 mean?

SMTP reply code 535 means authentication failed. It arrives immediately after an AUTH command and is nearly always accompanied by an enhanced code that narrows the reason, most often 5.7.8 for invalid credentials. It is the error almost every developer meets the first time an application tries to send through a real mail server.

The credentials being wrong is only one possibility, and often not the interesting one. Providers have spent several years removing the ability to authenticate with a plain account password. Google returns 535 5.7.80 for a username and password not accepted, and 534 5.7.90 when an application-specific password is required instead. Microsoft returns 535 5.7.139 when SMTP AUTH is disabled for the tenant or the mailbox, and 535 5.7.142 or 5.7.143 when an OAuth token has expired. In each of those the password may be perfectly correct and still refused.

The durable fix is to stop authenticating as a person. An application holding a user's mailbox password breaks whenever that person changes it, leaves, or has multi-factor authentication enabled, and it is the pattern every provider is actively closing off. Move to OAuth 2.0, or to a dedicated relay with an API key issued for the purpose.

How 535 plays out

Your server attempts delivery
The recipient server returns a permanent 535 rejection
This is a hard bounce: the message will not be accepted as sent
Suppress the address and fix the root cause before resending

Where 535 sits: soft vs hard bounce

Soft bounce (4xx) Hard bounce (5xx)
NatureTemporaryPermanent
SMTP class4xx5xx
What to doLet it retrySuppress the address
Recoverable?OftenNo
535 is✓ this code

What each provider means by 535

A registered code does not oblige a provider to use it that way, and the large ones diverge. Match the wording in your own bounce, not the definition above.

Gmail 535 5.7.80 username and password not accepted, or 534 5.7.90 application-specific password required Reference
Exchange Online 535 5.7.139 SMTP AUTH disabled, 5.7.142 and 5.7.143 for expired OAuth tokens Reference

Common causes of 535

  • The username or password is genuinely incorrect or has been changed
  • SMTP AUTH is disabled for the tenant or for the specific mailbox
  • The account has multi-factor authentication and requires an app password
  • An OAuth access token has expired or was revoked
  • Authentication was attempted before STARTTLS, and the server refuses credentials in cleartext
  • The wrong authentication mechanism was offered, such as LOGIN where only XOAUTH2 is permitted

How to fix 535

  • Confirm SMTP AUTH is enabled for the mailbox, not just that the password is right
  • Move to OAuth 2.0 rather than storing an account password in an application
  • Where OAuth is unavailable, issue an app password instead of using the login password
  • Start TLS before authenticating, since most servers refuse credentials on a cleartext session
  • Use port 587 with STARTTLS, or 465 with implicit TLS, rather than port 25 for submission
  • Send through a dedicated relay with an API key rather than a personal mailbox

Frequently asked questions

What does SMTP error 535 mean?
It means authentication failed. The server received your AUTH command and rejected the credentials. It usually arrives with an enhanced code that says more: 5.7.8 for invalid credentials generally, 5.7.80 or 5.7.90 from Google, and 5.7.139 or 5.7.142 from Microsoft for disabled SMTP AUTH and expired OAuth tokens respectively.
My password is definitely correct, so why do I get 535?
Because a correct password is no longer sufficient at most providers. SMTP AUTH may be disabled for the tenant or mailbox, the account may have multi-factor authentication requiring an app password, or the provider may only accept OAuth. Microsoft in particular disables SMTP AUTH by default on new tenants, which produces a 535 with entirely valid credentials.
How do I fix 535 with Microsoft 365?
Check whether SMTP AUTH is enabled for the specific mailbox, since Microsoft disables it by default and the tenant-level setting is separate from the per-mailbox one. Then confirm you are using port 587 with STARTTLS. If you are using OAuth, a 535 5.7.142 or 5.7.143 means the token expired rather than that anything is misconfigured.
Should I use an app password or OAuth?
OAuth where the platform supports it, because tokens can be scoped and revoked without disturbing the account. App passwords are a reasonable fallback for software that cannot do OAuth, but they are a shared secret with full mailbox rights and providers are steadily withdrawing them. Either is better than storing a user login password.
Why does authentication fail only on port 25?
Port 25 is for server-to-server relay, not for submission, and most servers refuse to accept credentials on it, often refusing them in cleartext regardless of port. Use 587 with STARTTLS for authenticated submission, or 465 with implicit TLS. Sending authenticated mail on port 25 is the wrong shape of connection.
Reviewed by Jennifer Jackson, Email Deliverability Analyst · June 2026 ← All bounce codes