How to Fix Microsoft 365 SMTP Authentication Errors 5.7.57 and 535.7.139
Question details
The user is unable to send emails through Microsoft 365 using a third-party application due to server authentication errors.
- Product
- Microsoft 365
- Device & OS
- not provided
- Scenario
- Attempting to send emails from an external application (like Horizon) using Microsoft 365 SMTP servers.
- Observed behavior
- The SMTP server rejects the connection, returning errors 5.7.57 and 535 5.7.139, indicating that a secure connection is required or the client was not authenticated.
Ensure you have Microsoft 365 administrator privileges, as resolving this issue requires checking tenant-level security settings and mailbox permissions.
Update SMTP Client Submission Configuration
Ensure your third-party application is using the exact server settings required by Microsoft 365 to establish a secure connection.
Microsoft 365 strictly requires TLS encryption and specific port configurations to authorize SMTP client submissions. If the application is using outdated ports (like port 25) or unencrypted connections, the server will actively reject the authentication request with a 5.7.57 error.
Open your application's email settings and set the outgoing SMTP server strictly to 'smtp.office365.com'.
Change the outgoing server port to 587. Do not use port 25 or 465 for standard client submission.
Select 'TLS' or 'STARTTLS' for the encryption method. Microsoft 365 requires this to secure the credentials during transmission.
Ensure the username entered is the full Microsoft 365 email address and that the password is correct.
Enable Authenticated SMTP and Verify Security Policies
Check the Microsoft 365 Admin Center to ensure SMTP authentication is enabled for the mailbox and that security defaults aren't blocking it.
Looking for a Hassle-Free Office Solution?
If configuring complex Microsoft 365 server settings and managing tenant policies is slowing down your workflow, consider switching to WPS Office. It provides a lightweight, highly compatible alternative for all your document management needs without complicated administrative overhead.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install the Software: Run the setup file and follow the quick installation wizard to set up WPS Office on your computer.
- 3. Open Your Documents: Launch WPS Office and instantly open, edit, and share your existing Microsoft Office files with full compatibility.

Frequently Asked Questions
What does Microsoft 365 SMTP error 535 5.7.139 mean?
This error specifically means that authentication failed because the Microsoft 365 tenant is blocking basic legacy authentication. This typically happens when Security Defaults are enabled or when the user account requires Multi-Factor Authentication (MFA).
Can I use port 25 for Microsoft 365 SMTP client submission?
No, Microsoft 365 specifically requires port 587 with TLS encryption for standard SMTP client submission. Port 25 is primarily reserved for SMTP relay and is frequently blocked by local Internet Service Providers to prevent spam.
How do I bypass MFA for an application that needs to send email?
You cannot bypass MFA directly using standard credentials. Instead, you must log into the Microsoft 365 account's security settings, generate a specific 'App Password', and use that unique password in your application's SMTP settings.
Why do I get a 'secure connection is required' message?
This occurs because your application is attempting to send the username and password in plain text over an unencrypted connection. You must enable 'TLS' or 'STARTTLS' in your application's outgoing email server settings to resolve this.




