5.7.57 Client not authenticated to send mail: Microsoft 365 fix
The Microsoft 365 error "5.7.57 Client not authenticated to send mail." means Exchange Online received your message without a login it accepts. Check that your client actually authenticates on smtp.office365.com port 587, that SMTP AUTH is enabled for the mailbox, and that Basic auth isn't blocked.
Sohail Hussain11 min readShort answer
- 5.7.57 means Microsoft 365 treated your SMTP session as unauthenticated, so check first that the app logs in with a full mailbox address and password (or an OAuth token) on smtp.office365.com port 587 with STARTTLS.
- Then confirm Authenticated SMTP is enabled for that mailbox and that Security Defaults, Conditional Access or MFA aren't blocking Basic authentication.
- If Basic auth is blocked on purpose, move the client to OAuth or use an SMTP relay connector instead of weakening the tenant.
You're probably seeing this in an app log, a script, or a printer's error screen:
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 Client not authenticated to send mail.
Sometimes the same line is followed by 535 5.7.139 Authentication unsuccessful and a reason, or it arrives as 530 5.7.57. The code is generic, so the real cause is in the surrounding text and in your tenant settings.
Why Microsoft 365 returns 5.7.57
5.7.57 is an enhanced status code. The leading 5 is a permanent failure, and 7.x is a security or policy refusal. Microsoft's server is saying the session reached the point of sending mail without a login it accepts, so retrying the same request won't change the result.
Microsoft's own troubleshooting article for printers and line-of-business apps lists 535 5.7.3 Authentication unsuccessful and 5.7.57 Client not authenticated to send mail as errors to check together. In practice the causes below cover nearly every case, most common first:
| Cause | What you see | Fix |
|---|---|---|
| App never logs in (no password, anonymous) | Often Client was not authenticated to send anonymous mail during MAIL FROM | Enter full mailbox credentials, or use direct send or a relay |
| Authenticated SMTP disabled on the mailbox | 5.7.57, sometimes with 535 5.7.139 | Enable SMTP AUTH for the mailbox |
| Security Defaults or Conditional Access blocks legacy auth | 535 5.7.139 ... security defaults policy | Move to OAuth, or scope an exception |
| MFA on a plain password login | Password works in the browser, fails over SMTP | Use OAuth, not a password |
| Tenant-wide SMTP AUTH off | SmtpClientAuthentication is disabled for the Tenant | Admin enables it, or migrate to OAuth |
| Wrong endpoint for the method | smtp.office365.com used for direct send | Use the right endpoint for the method |
| Consumer Outlook.com account | SMTP AUTH disabled, no toggle | Use OAuth or a business tenant |
| Old TLS on the device | Connection fails, sometimes with this code | Update firmware; see the TLS step |
Step-by-step fixes
1. Confirm the client really logs in
This is the cheapest check. Microsoft explains that if a printer didn't require a password for the username you entered, it's trying to send email without logging on, and SMTP AUTH client submission requires it to sign in. The same applies to apps and libraries.
Microsoft's recommended client settings are server smtp.office365.com, port 587 (recommended) or 25, TLS/StartTLS enabled, and the mailbox's username and password. Test from a terminal with swaks (it prompts for the password):
swaks --server smtp.office365.com --port 587 --tls \
--auth LOGIN --auth-user sender@example.com \
--from sender@example.com --to you@example.net
If the transcript reaches 235 2.7.0 Authentication successful and the message goes through, the tenant is fine and the original app is misconfigured. If it fails at AUTH, continue below.
Also check the sender address. The app must send from the same address it logs in with. If it sends from another account, the login account needs Send As permission for it; otherwise you get a different error, 5.7.60.
2. Enable Authenticated SMTP for the mailbox
In Exchange Online PowerShell, check the mailbox:
Get-CASMailbox -Identity sender@example.com | Format-List SmtpClientAuthenticationDisabled
If it returns True, enable it:
Set-CASMailbox -Identity sender@example.com -SmtpClientAuthenticationDisabled $false
In the admin center, go to Active users, select the user, open the Mail tab, choose Manage email apps and make sure Authenticated SMTP is checked. Then check the organization default:
Get-TransportConfig | Format-List SmtpClientAuthenticationDisabled
Microsoft notes that SMTP AUTH is disabled for organizations created after January 2020, but you can enable it per mailbox.
For a shared mailbox, enable it on the user account that actually authenticates, and give that user Send As on the shared mailbox. Users on Microsoft's Q&A site report this exact combination, with a shared, unlicensed mailbox, as a cause.
3. Check Security Defaults, MFA and Conditional Access
Basic authentication is a plain username and password. Microsoft states that client SMTP submission using Basic authentication isn't compatible with Security Defaults in Microsoft Entra ID. A bounce that mentions a security defaults policy confirms it.
- Sign in to the Microsoft Entra admin center and open the Sign-in logs for the sending user.
- Filter to the time of the failure and read the client app and the failure reason.
- If a Conditional Access policy blocked it, the log names the policy.
- Decide: move the client to OAuth (best), or exclude only this one mailbox from the legacy-authentication policy.
Microsoft's troubleshooting article lists three workarounds: disable MFA on the mailbox, switch off Security Defaults, or exclude the user from a Conditional Access policy that blocks legacy authentication. The same article cautions against turning off Security Defaults unless you understand the risks. I'd skip that one: it lowers protection for every account in the tenant to rescue one sender.
Don't switch off tenant-wide protection
Turning off Security Defaults or MFA to make one app send mail exposes every account. Exclude a single dedicated mailbox, give it a long unique password, and plan to move it to OAuth.
4. Check the endpoint matches the method
Microsoft 365 has separate ways to send, and each uses a different endpoint. Client submission needs a Microsoft 365 username and password, SMTP relay needs a static IP that Microsoft 365 can see, and direct send needs no authentication.
If you send without a login, don't use smtp.office365.com. Microsoft's guidance is that that endpoint can't be used for direct send; use your organization's MX endpoint, which ends in mail.protection.outlook.com. The reverse mistake also causes this error: an app that expects to log in, pointed at the MX endpoint.
One user on Microsoft's Q&A site reported sporadic 530 5.7.57 errors on mail arriving at an on-premises Exchange server in a hybrid setup. The cause was a receive connector that allowed only a list of specific Microsoft IPs. If your error comes from your own Exchange server rather than from smtp.office365.com, check connector IP allow lists.
5. Rule out TLS and network problems
Microsoft's article says devices must support TLS 1.2 or above. If you must keep a legacy device, you opt in with the AllowLegacyTLSClients parameter on Set-TransportConfig, and the device must submit to smtp-legacy.office365.com. Treat that as temporary.
Also test the port from the same network. If you can't connect, a firewall or ISP might be blocking port 587 or 25.
6. Move to OAuth or a relay
Microsoft's deprecation page says that although SMTP AUTH is available, it has announced plans to retire Basic authentication for SMTP AUTH in Exchange Online. The page also says the retirement timeline has been updated and points to the latest official announcement. People on Microsoft's community forums report that Basic SMTP AUTH is switched off by default in existing tenants around the end of December 2026, with admins able to turn it back on. I couldn't confirm that date on a Microsoft documentation page, so check the Exchange Team announcement for your tenant.
Your options:
- OAuth for SMTP AUTH. OAuth 2.0 support for POP, IMAP and SMTP AUTH was released in 2020, and your app must implement it. This is the right answer for any tool with a "Sign in with Microsoft" flow.
- Microsoft Graph. For your own code, Microsoft suggests moving to OAuth 2.0 or a newer protocol such as the Graph API. It's an API call, not SMTP.
- SMTP relay with a connector. For devices that can't do OAuth, this authenticates by IP address. Your printer or app host needs a static public IP that Microsoft 365 sees. Details are in Microsoft's guide to setting up a device or application to send email with Microsoft 365.
Pick OAuth if the client supports it, and a relay connector if it doesn't and sends from a fixed IP. Re-enabling Basic auth is the last resort.
Personal Outlook.com accounts
Users report that new personal Outlook.com mailboxes have SMTP AUTH disabled with no toggle, so a password-based client fails even though receiving works. OAuth-capable clients are the route there, and consumer support is the only place to ask for changes.
Checklist before you try again
- The app sends a username (full address) and password, or an OAuth token, every time.
- Server is
smtp.office365.com, port 587, STARTTLS on. - The From address matches the login, or the login has Send As rights.
Get-CASMailboxshowsSmtpClientAuthenticationDisabledasFalse(or empty, following the org setting).- The Entra sign-in log shows no Conditional Access or Security Defaults block.
- The device supports TLS 1.2 or later.
- You're not mixing up the client submission and MX (direct send) endpoints.
If nothing works
Contact your Microsoft 365 admin first; tenant switches and policies are theirs. If you are the admin, open a Microsoft 365 support ticket. For a personal Outlook.com account, use Microsoft's consumer support. Include:
- The full SMTP transcript or bounce, with timestamps and time zone
- The sending IP, the sender address and a recipient address
- The output of
Get-CASMailboxandGet-TransportConfigfrom the commands above - The Entra sign-in log entry for the attempt, plus a message trace if one exists
- What you already tried (endpoint, port, MFA, Security Defaults)
Subject: SMTP AUTH refused with 5.7.57 Client not authenticated to send mail
Our app sends through smtp.office365.com:587 (STARTTLS) as sender@example.com
and receives: "5.7.57 Client not authenticated to send mail."
First failure: {date and time, time zone}
Sending IP: {public IP}
SmtpClientAuthenticationDisabled (mailbox): {value}
SmtpClientAuthenticationDisabled (org): {value}
Entra sign-in log result: {failure reason, or "no entry"}
Already tried: {Authenticated SMTP enabled, Security Defaults status,
Conditional Access review, TLS 1.2 check}
Please confirm what blocks SMTP AUTH for this mailbox and whether OAuth
or a relay connector is the supported route for this tenant.
If you connect Microsoft 365 to Mailneo
This error comes from your Microsoft tenant, and Mailneo can't change Microsoft settings or unblock a mailbox. We can help with one part: Mailneo connects Outlook and Microsoft 365 mailboxes by OAuth, accepts SMTP accounts, and can test a connection, so a failed test shows you the error to take back to your admin. See the email accounts documentation for the setup options.
Common questions
Is 5.7.57 the same as 535 5.7.3 or 535 5.7.139?
Not exactly, but they often appear together. 535 5.7.3 means a login was attempted and failed; 535 5.7.139 carries a reason such as a tenant or Security Defaults block, and users report it printed right after the 5.7.57 text. Read the reason text, because it points to the cause.
Does an app password fix it?
Often not. One user on Microsoft's Q&A site reported the same error with an app password, and Microsoft says the Basic auth retirement also affects app passwords for apps that can't do two-step verification. Use OAuth instead of building on app passwords.
Why does my password work in Outlook on the web but not over SMTP?
Signing in on the web proves the account works, which Microsoft recommends as a first test. SMTP is separate: Authenticated SMTP must be on for the mailbox, and policies on legacy authentication apply to it. A working web login with a failing SMTP login points to the mailbox setting, Security Defaults, MFA or Conditional Access.
Will SPF, DKIM or DMARC fix this error?
No. Those decide whether accepted mail reaches the inbox, not whether Microsoft lets you send. Once sending works, review SPF, DKIM and DMARC for your domain.
Explore: Email Deliverability
Related Articles
0x800ccc0e: Outlook Unable to Connect to SMTP Server, Fixed
Outlook error 0x800ccc0e means the app could not open a connection to your outgoing (SMTP) server. Usually the port, encryption setting or password is wrong, or antivirus, a firewall or your ISP is blocking it. Set port 587 with STARTTLS, turn on SMTP authentication, and test again.
SocketLabs "421 4.5.1 Too many errors" blacklist: how to fix it
`421 4.5.1 Too many errors, you have been temporarily blacklisted` means a SocketLabs server saw repeated auth or bad-address errors from your IP and paused it. Stop whatever is retrying, fix credentials and invalid recipients, clear the queue, and wait. The block usually lifts within minutes, but returns if retries resume.
421-4.7.0 Gmail Has Detected This Message Is Suspicious: Fix
The 421-4.7.0 "suspicious due to the nature of the content and/or the links" error means Gmail's content filter rejected your message after DATA, not an authentication check. Remove click tracking or move it to your own domain, drop URL shorteners, check link reputation, then retest with a plain message.
421 4.7.0 IP not in whitelist for RCPT domain: what it means
The error 421 4.7.0 IP not in whitelist for RCPT domain means the recipient's mail gateway, usually Mimecast in reports, only accepts connections from approved IPs, and the Google sending IP isn't on that list. The fix is on the recipient side: their admin must allow the IPs or change the mail routing.
Ready to supercharge your email marketing?
Start sending smarter emails with AI-powered campaigns. No credit card required.
Get Started Free