Skip to content

535 5.7.139 Authentication Unsuccessful: How to Fix It

What the 535 5.7.139 authentication unsuccessful error from Microsoft 365 means, how to read the text after the code, and how to fix each cause.

Nov 23, 2026 5 min read 1,149 words
535 5.7.139 Authentication Unsuccessful: How to Fix It
535 5.7.139 authentication unsuccessful error in Microsoft 365
535 5.7.139 authentication unsuccessful error in Microsoft 365

Your app, script or printer tries to send mail through Microsoft 365. It stops with "535 5.7.139 Authentication unsuccessful". Unlike most login errors, this one often tells you why. The words after the code point to the setting that blocked you.

This guide explains how to read the error, what each message means, and how to fix it as a user or an admin.

What 535 5.7.139 means#

The reply has two parts. 535 is the SMTP code for a failed login. The server heard your user name and password (or token) and said no. 5.7.139 is Microsoft's enhanced status code. The first 5 means the failure is permanent for this try. The 7 points to a security or policy reason.

You only see this error when a device or app signs in to smtp.office365.com to send mail. Microsoft calls this client SMTP submission, or SMTP AUTH. Outlook and the phone apps don't use it. Printers, websites, CRMs, outreach tools and scripts do.

So the person you are writing to is not the problem. Nothing has left your side yet. The sign-in failed before any mail was sent.

Read the text after the code#

Microsoft adds a short reason after the code. That text is the fastest way to find the fix. These are the versions people report most often, including in Microsoft's own Q&A.

Text after the code What it points to
SmtpClientAuthentication is disabled for the Tenant SMTP AUTH is off for the whole tenant
SmtpClientAuthentication is disabled for the Mailbox SMTP AUTH is off for this one mailbox
basic authentication is disabled A policy blocks password sign-in for SMTP
user is locked by your organization's security defaults policy Security defaults are on
the user credentials were incorrect Wrong user name or password
the request did not meet the criteria to be authenticated successfully Often MFA or a Conditional Access rule

If your app hides the full reply, run a test or check its logs. The reason is what matters.

Why Microsoft 365 blocks the sign-in#

Microsoft's guide to authenticated client SMTP submission explains the switches behind the messages above.

  1. The tenant switch. Microsoft recommends keeping SMTP AUTH off for the tenant. It turns it on only for the mailboxes that need it.
  2. The mailbox switch. A per-mailbox setting, "Authenticated SMTP", wins over the tenant setting.
  3. Security defaults. When security defaults are on, SMTP AUTH is already off.
  4. Authentication policies. A policy can block basic auth for SMTP. Then a password fails even when SMTP AUTH is on.
  5. MFA and Conditional Access. A rule that asks for a second factor blocks an app that can only send a password.

How to fix 535 5.7.139#

Start with the reason in the error text. Then work through the matching step.

Step 1: Turn on Authenticated SMTP for the mailbox#

This fixes "disabled for the Mailbox". In the Microsoft 365 admin center, go to Users, then Active users. Pick the user, open Mail, then Manage email apps. Tick "Authenticated SMTP" and save.

The same change in PowerShell:

Set-CASMailbox -Identity printer@contoso.com -SmtpClientAuthenticationDisabled $false

Wait a few minutes before you test again. Changes can take a short while to apply.

Step 2: Leave the tenant switch off if you can#

This fixes "disabled for the Tenant". You don't need to turn SMTP AUTH on for everyone. Turn it on for the one mailbox in Step 1, and the mailbox setting wins.

Only change the tenant setting if many mailboxes need it:

Set-TransportConfig -SmtpClientAuthenticationDisabled $false

Step 3: Check security defaults and auth policies#

This fixes "security defaults policy" and "basic authentication is disabled". If security defaults are on in Microsoft Entra ID, SMTP AUTH stays off. Microsoft says you must turn them off to use it, or move the app to another way of sending.

Then check your authentication policies. If one blocks basic auth for SMTP, a password sign-in fails whatever the mailbox says. Turning security defaults off is a big change, so plan it with your security team.

Step 4: Handle MFA and Conditional Access#

This fixes "did not meet the criteria". An app that sends a password can't answer an MFA prompt. Look for a Conditional Access rule or per-user MFA that applies to this account. A dedicated mailbox for the device, with a narrow rule, is safer than turning MFA off for a person.

Step 5: Move to OAuth where you can#

Microsoft has said it plans to retire basic auth for SMTP AUTH. A password fix may stop working later. OAuth 2.0 is the lasting path. Most CRMs and outreach tools offer a "Sign in with Microsoft" button that handles it for you.

Authenticated SMTP must still be on for the mailbox. OAuth does not skip that switch.

How it compares to similar codes#

Code What it usually means Who fixes it
535 5.7.139 Sign-in blocked, reason named in the text Admin
535 5.7.3 Microsoft 365 refused the sign-in, no reason given Admin or user
535 5.7.8 Gmail refused the user name or password User
530 5.7.0 The app did not start TLS first User

If your error says 5.7.3 instead, our guide to 535 5.7.3 authentication unsuccessful has the full SMTP settings table. Gmail users should read 535 5.7.8 username and password not accepted. If the server asks you to start TLS first, see 530 5.7.0.

535 5.7.139 Checklist#

  • Read the full text after the code
  • Authenticated SMTP ticked for the sending mailbox
  • Security defaults and auth policies checked
  • No MFA prompt for an app that can only send a password
  • Server smtp.office365.com, port 587, STARTTLS on
  • OAuth set up where the app supports it

FAQ#

What does 535 5.7.139 mean?#

It means Microsoft 365 refused the SMTP sign-in from your app or device. The text after the code usually names the setting that blocked it.

Is 535 5.7.139 a password problem?#

Only when the text says the credentials were incorrect. Most of the time the password is fine and a tenant, mailbox or security setting blocks the sign-in.

Do I have to turn off security defaults?#

To use SMTP AUTH with a password, yes. The other choice is to move the app to OAuth or to a different way of sending.

Will my emails be sent later?#

No. A 535 is not a delay. The app must sign in again after you fix the cause.

Why does it work for one mailbox and not another?#

The mailbox switch, its auth policy or its MFA setting differ. Compare the two accounts setting by setting.

Once your app can send again, keep your bounce rate low. Our guide to email bounce codes explains the next errors you may see, and the Tomba Email Verifier checks a list before you send.

// start free

See who Tomba finds at any company

Type a company's domain to see its people, their roles and verified work emails, each with the pages it was found on. Free account, no card.

Free plan · No credit card required · GDPR & CCPA

Share
0 clapsEnjoyed it? Give a clap.
AU

// about the author

Tomba Editorial Team

Was this helpful?