Fix Microsoft 365 SMTP Connection Refused on Port 587
Question details
Resolve an application's refused connection to Microsoft 365 SMTP on port 587.

- Product
- Microsoft 365 Exchange Online SMTP
- Device & OS
- not provided
- Scenario
- An application uses authenticated SMTP to send mail through a Microsoft 365 mailbox.
- Observed behavior
- The application reports a connection refused error even though TLS and port 587 are configured.
Identify the server running the application and obtain its SMTP settings and full error message. Run network tests from that server or its network, not from an unrelated device.
Verify the Microsoft 365 SMTP submission settings
Use the correct client submission endpoint and check whether authenticated SMTP is available for the mailbox.
Open the application's outgoing mail or SMTP settings. Set the server to smtp.office365.com and the port to 587.
In the application's SMTP security settings, select STARTTLS, sometimes labeled explicit TLS, rather than implicit SSL/TLS.
In the Microsoft 365 admin center, go to Users > Active users, select the sending user, and open Mail > Manage email apps. Check whether Authenticated SMTP is enabled; also have an administrator verify tenant-level settings and supported authentication methods.
Save the SMTP settings and send a test message from the application. Record the full error and whether it occurs during connection, TLS negotiation, or authentication.

Test port 587 from the application server
Use this approach to identify network, firewall, proxy, or hosting-provider restrictions.
Use WPS Office for Documents While You Troubleshoot SMTP
WPS Office is a free, lightweight Office alternative with a familiar interface and Microsoft Office format compatibility, making it easy to move everyday document work. It does not repair Microsoft 365 SMTP connections.

Frequently Asked Questions
Which server and security setting should I use for Microsoft 365 SMTP?
For authenticated client submission, configure smtp.office365.com on port 587 and select STARTTLS, also called explicit TLS.
Why does Outlook on the web work when my application cannot connect?
Outlook on the web and your application may use different network paths and protocols. A working web mailbox does not establish that the application server can reach smtp.office365.com on port 587.
How can I test port 587 from a Windows server?
Open PowerShell on the application server and run Test-NetConnection smtp.office365.com -Port 587. Check the TcpTestSucceeded result and share a failed test with your network administrator.
Does enabling authenticated SMTP fix a connection refusal?
Not by itself. A refused connection occurs before authentication, so first verify the endpoint and network access. Authenticated SMTP and a supported authentication method are still needed when the application reaches the server.




