535 5.7.139: User credentials were incorrect

Microsoft 365SMTPSign-in problem

The error usually looks like this:

535 5.7.139 Authentication unsuccessful, the user credentials were incorrect.

What it means

Microsoft 365 did not accept the username and password your app sent.

Common causes

  • The password is wrong, has expired, or was recently changed.
  • The username is not the full email address (user principal name) of the account.
  • The account has MFA enabled, so its normal password cannot be used for SMTP.

How to fix it

  1. Check the username is the full email address and re-enter the password.
  2. If the account uses MFA, or basic authentication has been retired for your organization, a password alone will not work – use OAuth 2.0, or Auth-Email if your app cannot.

Tools to help diagnose it

Can’t update your app to use OAuth?

Auth-Email fixes sign-in errors like this one without changing your app, printer, scanner or script. It signs in to Microsoft 365 with OAuth on your app’s behalf, while your app keeps using a normal username and password over IMAP, POP or SMTP.

← Look up another email error