logo
search
Exchange Connection Problems

How to Fix Microsoft 365 SMTP Authentication Errors 5.7.57 and 535.7.139

Maira MehtabMaira Mehtab Sep 20, 2026 868 views

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.
Before you start

Ensure you have Microsoft 365 administrator privileges, as resolving this issue requires checking tenant-level security settings and mailbox permissions.

Solution 1Recommended

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.

1
Configure the SMTP Server Name

Open your application's email settings and set the outgoing SMTP server strictly to 'smtp.office365.com'.

2
Set the Correct Port

Change the outgoing server port to 587. Do not use port 25 or 465 for standard client submission.

3
Enable Encryption

Select 'TLS' or 'STARTTLS' for the encryption method. Microsoft 365 requires this to secure the credentials during transmission.

4
Verify Credentials

Ensure the username entered is the full Microsoft 365 email address and that the password is correct.

Application Support: If your application does not support TLS 1.2 or higher, it will not be able to connect to Microsoft 365 SMTP servers regardless of these settings.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the Software: Run the setup file and follow the quick installation wizard to set up WPS Office on your computer.
  3. 3. Open Your Documents: Launch WPS Office and instantly open, edit, and share your existing Microsoft Office files with full compatibility.
100% free and lightweight Office suite for everyday tasksSeamlessly compatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar tabbed interface that requires zero learning curveEasily share documents and files without complex SMTP server configurations
microsoft office alternative - wps office

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.