How to Fix Microsoft 365 SMTP Connection Closes After QUIT Command
Question details
The user encounters a diagnostic error when an authenticated SMTP connection to Microsoft 365 closes unexpectedly after issuing the QUIT command.

- Product
- Microsoft 365 Exchange
- Device & OS
- not provided
- Scenario
- Attempting to send an email or test an SMTP connection via smtp.office365.com on port 587 using TLS with valid credentials.
- Observed behavior
- The connection successfully authenticates but terminates immediately after the QUIT command is sent, returning diagnostic error information instead of closing gracefully.
Verify that your local firewall or antivirus software is not actively scanning or terminating outbound SMTP traffic on port 587.
Test the SMTP Connection on an Alternative Network
Switching to a different network helps determine if your current Internet Service Provider (ISP) or local router is prematurely terminating the SMTP session.
Network-level security appliances or ISP configurations can sometimes interfere with SMTP traffic, especially during the termination phase of the connection. Bypassing your primary network is the fastest way to isolate the issue.
Turn off your current Wi-Fi or unplug your Ethernet cable to disconnect from the local network environment where the error occurs.
Enable the mobile hotspot feature on your smartphone and connect your computer to this new cellular network.
Execute your SMTP connection test using smtp.office365.com on port 587 with TLS. Check if the connection still returns a diagnostic error after the QUIT command.

Contact Microsoft 365 Technical Support
If network isolation does not resolve the problem, the issue likely resides in backend authentication or service-side configurations that require Microsoft's intervention.
Looking for a Reliable and Free Office Suite?
While resolving complex Microsoft 365 backend and Exchange issues, you shouldn't have to pause your daily productivity. WPS Office offers a free, lightweight, and highly compatible alternative for all your document, spreadsheet, and presentation needs.
- 1. Visit the official website: Go to the official WPS Office website to access the latest secure download.
- 2. Download the installer: Click the 'Free Download' button to get the lightweight installation package for your operating system.
- 3. Install and start working: Run the installer and open WPS Office to immediately start editing your existing Microsoft Office documents.

Frequently Asked Questions
Why does Microsoft 365 SMTP use port 587?
Port 587 is the standard port for authenticated SMTP client submission. It is required by Microsoft 365 to ensure that emails are transmitted securely using STARTTLS encryption.
What is the purpose of the QUIT command in an SMTP session?
The QUIT command is sent by the client to inform the SMTP server that it has finished sending instructions. The server responds and then gracefully closes the transmission channel.
Can outdated TLS settings cause SMTP connection drops?
Yes. Microsoft 365 enforces the use of TLS 1.2 or higher for all connections. If your application or operating system defaults to older TLS versions, the connection may fail or drop unexpectedly during the session.




