This article explains the possible causes for the “STARTTLS is required” error and how to fix it and send an email successfully.
What Does the StartTLS is Required Error Mean?
When you try to send an email through an SMTP server that requires TLS encryption, you may receive the error message “5.7.3 STARTTLS is required”.
In my case, I encountered the error “450 4.4.317 Cannot connect to remote server. 5.7.3 STARTTLS is required to send mail ” in the Exchange Online (Microsoft 365) message tracking log when I tried to send an email to an external SMTP server.

This error can occur in different apps (SQL Server, Jenkins), scripts and programming languages (Visual Basic, PowerShell, Python, Java, C#).
Troubleshooting STARTTLS Errors in Exchange Online
If you are facing the error 450 4.4.317 Cannot connect to remote server. 5.7.3 STARTTLS is required to send mail when Exchange Online sends email to an external SMTP server, you should troubleshoot the outbound mail flow between Exchange Online and the destination server. Changing TLS settings on your workstation or in a PowerShell script will not fix a TLS negotiation problem in this server-to-server connection. Follow the steps below:
1. Check Message Trace
In the Exchange admin center, open Mail flow > Message trace and locate the affected message. You need to review its delivery status and event details in order to determine if Exchange Online is retrying delivery/encountering a persistent failure.
2. Check the outbound connector
Connect to Exchange Online PowerShell and inspect the configured outbound connectors:
Connect-ExchangeOnline
Get-OutboundConnector |
Format-List Name,Enabled,ConnectorType,RecipientDomains,SmartHosts,UseMXRecord,TlsSettings,TlsDomain
Determine if an outbound connector applies to the affected recipient domain and review its TLS requirements. If the connector requires TLS authentication, you should verify that its settings match the capabilities and certificate presented by the destination server.
3. Verify STARTTLS and the destination certificate
Ask the destination mail server admin to verify that the SMTP service supports STARTTLS and can establish TLS successfully. If TLS negotiation fails, you need to investigate the destination server and the TLS requirements of the applicable outbound connector.
For a destination server you administer, you need to test its SMTP TLS config. Run the following command from PowerShell, Command Prompt, or a Bash-compatible shell where OpenSSL is installed:
openssl s_client -starttls smtp -connect smtp.example.com:25 -servername smtp.example.com -showcerts -verify_return_error -verify_hostname smtp.example.com
Don’t forget to replace smtp.example.com with the actual destination hostname and use the SMTP port configured for that service. This test checks the connection from the computer where OpenSSL runs; note that it does not reproduce Exchange Online’s network path/prove that Exchange Online trusts the certificate.
4. Fix the underlying issue
Correct the destination server’s STARTTLS config, certificate chain, TLS compatibility, or the applicable outbound connector settings as indicated by the diagnostics. You should not disable TLS requirements/weaken certificate validation merely in order to make delivery succeed.
After applying the fix, send a test message and review Message Trace again to confirm successful delivery.
SMTP Without Encryption vs With STARTTLS
The classic SMTP email protocol does not encrypt the connection between the server and the client, and all data is sent in clear text. The StartTLS protocol can be used to encrypt data transmitted within an SMTP session. If the SMTP server supports this protocol, the client sends the STARTTLS command, after which the parameters of the encrypted TLS session are negotiated between the server and the client. An encrypted TLS connection will be established over the current TCP connection, without the need to use a separate port for the encrypted connection. The StartTLS command is used by both SMTP and IMAP (POP3 commonly uses STLS (RFC 2595) for encryption).
You can manually check the StartTLS protocol support on the remote SMTP server. Open a command prompt and connect to the SMTP host using telnet:
telnet smtp.gmail.com 25
Note. In case telnet is not available, you can enable it with command:
Enable-WindowsOptionalFeature -Online -FeatureName TelnetClient
Then run the EHLO command to list the SMTP options supported by the remote server:
ehlo theitbros.com
In this case, the SMTP server response will contain the line: 250-STARTTLS, which means that the STARTTLS is supported by the server.

TLS Negotiation in SMTP and IMAP
The client can then send the STARTTLS command and receive the response ‘220 2.0.0 Ready to start TLS’. The client and SMTP server are ready to begin TLS negotiation.

Choose the Correct Troubleshooting Path
The troubleshooting steps depend on where the STARTTLS error occurs:
- Exchange Online outbound delivery: If Exchange Online reports 450 4.4.317 … 5.7.3 STARTTLS is required to send mail, investigate Message Trace, the applicable outbound connector, and the destination mail server’s STARTTLS config and certificate.
- SMTP client application: If PowerShell, SQL Server, Jenkins, or another app fails while connecting directly to an SMTP server, verify the SMTP port, STARTTLS config, authentication method, and TLS compatibility.
The PowerShell and Windows TLS settings described below apply to the second case. They do not fix TLS negotiation failures between Exchange Online and an external destination server.
Troubleshooting STARTTLS Errors in SMTP Client Applications
This error occurs when the client attempts to send email over an unencrypted connection, while the server requires the connection to be upgraded to TLS using the STARTTLS command.
If the SMTP server returns the StartTLS is Required error, check the following:
Client does not initiate STARTTLS
You may face this error when the client attempts to send email without upgrading the connection to TLS using the STARTTLS command, while the server requires it.
SMTP ports and TLS modes
- Port 587: Typically used for SMTP submission with STARTTLS. You need to use Send-MailMessage -UseSsl to enable TLS for this connection.
- Port 465: Uses implicit TLS, where TLS encryption is established immediately when the TCP connection opens. This mode is supported by modern SMTP libraries such as MailKit, but not by the legacy .NET System.Net.Mail.SmtpClient used by Send-MailMessage.
For SMTP submission, RFC 8314 recommends implicit TLS on port 465 and also recommends supporting STARTTLS on port 587 during the transition period. Both modes provide secure connections when TLS negotiation is mandatory and certificate validation is properly implemented.
For port 587, keep -UseSsl when the server requires STARTTLS. If the connection still fails, you should follow the certificate and TLS troubleshooting steps below.
Invalid or missing TLS Certificate
Check that the receiving server is configured to use TLS and presents a valid X.509 certificate with a complete certificate chain. Modern SMTP servers support TLS 1.2 or later, and many also support TLS 1.3. The TLS version negotiated depends on the capabilities and config of both endpoints, as well as the TLS implementation used by the OS and app. You can use the online service https://ssl-tools.net/ to check the remote SMTP host for support of STARTTLS and TLS 1.2 and other available SSL options.
You can check the SMTP server certificate and STARTTLS negotiation manually with the following command:
openssl s_client -starttls smtp -connect smtp.server.com:587 -servername smtp.server.com -showcerts -verify_return_error -verify_hostname smtp.server.com
This allows you to inspect the certificate chain, TLS version, and any certificate validation errors returned by the server.
Note. In case the SMTP server uses a certificate issued by a private CA, you need to specify the appropriate CA bundle with -CAfile. Make sure the file contains the required trusted CA certificates.
Optionally, first check basic connectivity to the SMTP service with the following command:
Test-NetConnection smtp.server.com -Port 587
TLS Support Not Enabled on Client or Server
Check if the OS, .NET runtime, and SMTP client library support the TLS versions required by the destination server. TLS 1.2 remains an important compatibility baseline, while TLS 1.3 can be negotiated when both endpoints and the underlying TLS implementation support it. You should not assume that enabling TLS 1.3 at the OS level automatically enables it for every app/SMTP service.
Application Misconfiguration (SQL, Jenkins, PowerShell)
In SMTP client applications, verify that the configured TLS mode matches the SMTP server’s requirements. Depending on the app, options such as Use SSL, Use TLS, or STARTTLS may have different meanings. For example, in Jenkins, Use SSL enables implicit TLS, while Use TLS enables STARTTLS. Using the wrong mode can cause the server to close the connection unexpectedly. Follow the steps below:
- STARTTLS is enabled by default in the on-premises Exchange Server. Check this: Get-SendConnector | fl IgnoreStartTLS
- If the app connects directly to Exchange Online using SMTP AUTH, you need to check if SMTP AUTH is permitted for the organization and mailbox. Use the command below:
# Check the organization-wide setting
Get-TransportConfig |
Format-List SmtpClientAuthenticationDisabled
# Check the mailbox-level setting
Get-CASMailbox user1@theitbros.com |
Format-List SmtpClientAuthenticationDisabled
Keep in mind that enabling SMTP AUTH does not guarantee that a client can authenticate using a username and password. SMTP AUTH supports OAuth 2.0, while Microsoft is retiring Basic Authentication for SMTP AUTH in Exchange Online. Under the updated timeline, Basic Authentication will be disabled by default for existing tenants at the end of December 2026, although admins will still be able to enable it. New tenants created after December 2026 will have Basic Authentication unavailable by default. Microsoft plans to announce the final removal date in the second half of 2027.
Note. Exchange Server 2016 and 2019 reached end of support on October 14, 2025. The Extended Security Update (ESU) Period 2 program ends on October 31, 2026, with no further extensions planned. The Get-SendConnector troubleshooting commands in this section apply to existing legacy deployments as well as supported Exchange environments. For supported on-premises deployments, you should use Exchange Server Subscription Edition (SE).
Troubleshooting Legacy Send-MailMessage Scripts
The Send-MailMessage cmdlet is obsolete and should not be used in new PowerShell scripts. However, you may encounter STARTTLS errors when troubleshooting existing scripts that still rely on this cmdlet. The following example is provided only to reproduce and troubleshoot an existing legacy script (it is not recommended for new apps):
Send-MailMessage -smtpServer smtp.theitbros.com -Port 587 -from "admin@theitbros.com" -to "team@theitbros.com" -subject "Alert" -body "Test TLS"
Such command may fail with an error:
Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first.

Or:
Send-MailMessage: Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail.
If you add the -UseSsl option to the PowerShell command, the error text changes:
Send-MailMessage : Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
This error indicates that the remote host closed the connection unexpectedly. You should verify if the configured port and TLS mode match the SMTP server’s requirements before changing TLS protocol settings.
Note. Send-MailMessage is obsolete and Microsoft recommends against using it in new scripts. Although it supports STARTTLS through .NET SmtpClient, it does not provide the flexibility and modern authentication capabilities required by many current SMTP deployments. You should use Microsoft Graph (Send-MgUserMail) when it meets your requirements, or MailKit when SMTP submission is required.
The following is a MailKit SMTP submission example for Exchange Online using STARTTLS and OAuth 2.0. It demonstrates message creation, TLS connection setup, OAuth authentication, and sending. It is not a standalone script: MailKit and MimeKit must be installed and loaded, and Get-ExchangeSmtpAccessToken must be implemented in order to obtain a valid access token for the selected OAuth flow. The Microsoft Entra app, Exchange Online permissions, and SMTP AUTH config must also be completed before running the example.
$message = [MimeKit.MimeMessage]::new()
$message.From.Add(
[MimeKit.MailboxAddress]::Parse('admin@contoso.com')
)
$message.To.Add(
[MimeKit.MailboxAddress]::Parse('user@contoso.com')
)
$message.Subject = 'STARTTLS test'
$message.Body = [MimeKit.TextPart]::new('plain')
$message.Body.Text = 'Test message sent over STARTTLS.'
$smtp = [MailKit.Net.Smtp.SmtpClient]::new()
try {
$smtp.Connect(
'smtp.office365.com',
587,
[MailKit.Security.SecureSocketOptions]::StartTls
)
# Obtain a valid OAuth 2.0 access token using
# a supported Microsoft Entra authentication flow.
$accessToken = Get-ExchangeSmtpAccessToken
$oauth2 = [MailKit.Security.SaslMechanismOAuth2]::new(
'admin@contoso.com',
$accessToken
)
$smtp.Authenticate($oauth2)
$smtp.Send($message)
}
finally {
if ($smtp.IsConnected) {
$smtp.Disconnect($true)
}
$smtp.Dispose()
}For production use, you should never hardcode passwords, client secrets, or access tokens in scripts. Store long-lived credentials and certificates in an approved secret store, such as Azure Key Vault, and obtain short-lived OAuth access tokens through a supported authentication flow.
Before running the example, you need to config the appropriate Microsoft Entra permissions and Exchange Online access for the selected OAuth flow:
- For delegated OAuth, request the https://outlook.office.com/SMTP.Send scope and obtain a token on behalf of a signed-in user.
- For app-only OAuth, config the SMTP.SendAsApp app permission with admin consent, request a token using the https://outlook.office365.com/.default scope, and register the app’s service principal in Exchange Online. Grant the app access only to the mailboxes it needs, using a supported Exchange authorization model. Also verify that SMTP AUTH is enabled where required.
MailKit supports explicit TLS modes and OAuth 2.0 authentication. The app must still use the correct TLS mode, authentication method, and permissions for the destination SMTP service.
Forcing TLS 1.2 in Legacy Windows PowerShell 5.1 Apps
Legacy .NET Framework apps that use ServicePointManager may require an explicit TLS 1.2 config if the app does not use the OS’s default TLS settings. The following command adds TLS 1.2 to the enabled protocol flags for APIs that honor this setting:
[Net.ServicePointManager]::SecurityProtocol = `
[Net.ServicePointManager]::SecurityProtocol -bor `
[Net.SecurityProtocolType]::Tls12
Note that this workaround is primarily applicable to Windows PowerShell 5.1 and older .NET Framework apps. Modern PowerShell (7+) and .NET versions use system-default TLS settings.
To inspect the protocol flags configured for ServicePointManager in the current session, run the command below:
[Net.ServicePointManager]::SecurityProtocol

This sets the TLS protocol selection for .NET Framework APIs that use ServicePointManager. Keep in mind that it does not guarantee that every SMTP connection will negotiate TLS 1.2, and it is generally unnecessary for modern PowerShell 7 applications that use system-default TLS settings.
For legacy .NET Framework apps, the SystemDefaultTlsVersions and SchUseStrongCrypto registry settings can affect TLS protocol selection and the use of strong cryptography. These settings do not provide a general TLS configuration mechanism for modern PowerShell 7+ applications running on modern .NET.
Before changing the registry, you should test the config in a non-production environment, export the affected registry keys/record their original values, and prepare a rollback plan. Admin privileges are required to modify these HKLM registry keys. Restart affected apps or services as needed to ensure that the changes take effect.
In enterprise environments, you should deploy approved changes through Group Policy, Microsoft Intune, or another config-management platform, following change-control procedures. Apply the settings only after confirming that the affected applications require them.
Run the following commands only in an elevated PowerShell session and only after reviewing the existing registry values.
Set-Itemproperty -Path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\' -Name SystemDefaultTlsVersions -Value 1 -Type DWord Set-Itemproperty -Path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v2.0.50727\' -Name SystemDefaultTlsVersions -Value 1 -Type DWord Set-Itemproperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319\' -Name SystemDefaultTlsVersions -Value 1 -Type DWord Set-Itemproperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v2.0.50727\' -Name SystemDefaultTlsVersions -Value 1 -Type DWord
For older .NET Framework apps, SystemDefaultTlsVersions is often not sufficient by itself. You should consider also enabling SchUseStrongCrypto to ensure strong TLS protocols are preferred:
# .NET Framework 4.x (64-bit) Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -Name SchUseStrongCrypto -Value 1 -Type DWord # .NET Framework 2.0–3.5 (64-bit) Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v2.0.50727' -Name SchUseStrongCrypto -Value 1 -Type DWord # .NET Framework 4.x (32-bit applications on 64-bit Windows) Set-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -Name SchUseStrongCrypto -Value 1 -Type DWord # .NET Framework 2.0–3.5 (32-bit applications on 64-bit Windows) Set-ItemProperty -Path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v2.0.50727' -Name SchUseStrongCrypto -Value 1 -Type DWord
After the applicable settings are configured, compatible .NET Framework apps can use the OS’s default TLS protocol selection and strong-cryptography settings. The effective behavior depends on the .NET Framework version, app config, and Windows TLS config.
Wrapping up
The cause of a STARTTLS error depends on where the failure occurs. For Exchange Online outbound delivery failures, you need to check Message Trace, the applicable outbound connector, and the destination server’s TLS config. For SMTP client app failures, verify the connection settings, authentication method, and TLS compatibility.
Send-MailMessage is obsolete. For new apps, you should consider Microsoft Graph when it meets your requirements, or MailKit when SMTP is required. Force TLS 1.2 only when diagnostics identify a legacy app that requires it.

Using Eudora client for Windows, I need to upgradt to the latest starttls. This article tells me how to upgrade but not where to download the file and in which directory to place it.
Can you advise?
One thing you should also consider is that, in a hybrid scenario with Exchange Online and Exchange On-Premises, if the firewall in front of the Exchange Server is doing sMTP / SPam inspection, that can and does casue this issue. On a Cisco ASA you have to add a “no fixup protocol smtp” which will solve this (that’s been known for years). On other firewalls, you may have to determine how to exclude the known/published Microsoft CIDR blocks form all SMTP inspection. Once you do that, your issue should be solved, assuming everything else with your Exchange server is working properly.