Fix Intermittent SQL Server 2016 SMTP Failures with Office 365
Question details
Users are experiencing intermittent failures when sending emails via SQL Server 2016 Database Mail through the Office 365 SMTP server.

- Product
- SQL Server 2016 and Office 365 Exchange
- Device & OS
- Windows Server 2012 R2
- Scenario
- Sending automated system emails through smtp.office365.com on port 587 using TLS 1.2.
- Observed behavior
- Some messages successfully send, while others fail intermittently. The failed messages never reach Office 365 and do not appear in Exchange message traces.
Verify that your firewall allows continuous outbound traffic on port 587 and ensure you have administrator privileges to modify the Windows Server Registry.
Enforce TLS 1.2 via Windows Registry Settings
Apply the recommended Windows Registry modifications to explicitly enforce TLS 1.2 protocols, ensuring a stable handshake with Office 365 servers.
Even if SQL Server 2016 supports TLS 1.2, intermittent connection drops often occur if the underlying Windows Server OS and .NET Framework are not strictly configured to use TLS 1.2 by default.
Press Win + R, type 'regedit' into the Run dialog, and press Enter to launch the Registry Editor with administrative rights.
Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols.
Create or modify the 'TLS 1.2\Client' and 'TLS 1.2\Server' subkeys. Ensure the 'DisabledByDefault' DWORD is set to 0, and the 'Enabled' DWORD is set to 1 for both.
Reboot the Windows Server to apply the registry changes, then trigger a test email from SQL Server Database Mail.

Review and Roll Back Problematic Windows Updates
Identify if recent Windows Server updates are causing the SMTP connectivity drops and temporarily uninstall them for testing.
Looking for a Lightweight Office Suite Alternative?
While server-side Exchange and SQL database issues require complex troubleshooting, your desktop office experience shouldn't. WPS Office offers a free, highly compatible, and lightweight alternative to Microsoft Office, perfect for managing everyday documents, spreadsheets, and presentations without heavy overhead.
- 1. Visit the WPS Website: Navigate to the official WPS Office website on your computer.
- 2. Download the Installer: Click the 'Free Download' button to get the lightweight installation package.
- 3. Install and Work: Run the installer and instantly start opening your existing Microsoft Office files with full compatibility.

Frequently Asked Questions
Why do failed SQL Server emails not appear in the Exchange message trace?
If the SMTP connection fails at the TLS handshake or network layer before the message data is successfully transmitted, Office 365 Exchange never actually receives the email. Consequently, it cannot log or trace the message.
Does SQL Server 2016 support TLS 1.2?
Yes, SQL Server 2016 supports TLS 1.2, but it heavily relies on the underlying Windows Server Operating System and .NET Framework settings. You must ensure the OS registry is configured to enable and prefer TLS 1.2.
What port should I use when sending Database Mail through Office 365?
You should configure Database Mail to use port 587 along with TLS/SSL encryption enabled when routing mail through smtp.office365.com.




