Exchange Connection Problems

Fix Intermittent SQL Server 2016 SMTP Failures with Office 365

Adam DavisAdam Davis Nov 4, 2026 869 views

Question details

Users are experiencing intermittent failures when sending emails via SQL Server 2016 Database Mail through the Office 365 SMTP server.

Fix Intermittent SQL Server 2016 SMTP Failures with Office 365
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.
Before you start

Verify that your firewall allows continuous outbound traffic on port 587 and ensure you have administrator privileges to modify the Windows Server Registry.

Solution 1Recommended

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.

1
Open the Registry Editor

Press Win + R, type 'regedit' into the Run dialog, and press Enter to launch the Registry Editor with administrative rights.

2
Navigate to the SCHANNEL Protocols

Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols.

3
Configure TLS 1.2 Keys

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.

4
Restart Server Services

Reboot the Windows Server to apply the registry changes, then trigger a test email from SQL Server Database Mail.

Enforce TLS 1.2 via Windows Registry Settings
Keep Systems Updated: Make sure your Windows Server OS and the .NET Framework are fully updated, as Microsoft frequently patches security channel (SCHANNEL) stability issues.
Free Microsoft Office alternative

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. 1. Visit the WPS Website: Navigate to the official WPS Office website on your computer.
  2. 2. Download the Installer: Click the 'Free Download' button to get the lightweight installation package.
  3. 3. Install and Work: Run the installer and instantly start opening your existing Microsoft Office files with full compatibility.
Free and lightweight office suite with no complex server dependenciesFully compatible with Microsoft Word, Excel, and PowerPoint formatsFamiliar user interface for a seamless and immediate transitionBuilt-in PDF editor and cloud sync across all your devices
microsoft office alternative - wps office

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.