Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

The Server Response was 5.7.3 STARTTLS is Required to Send Mail

December 17, 2022
in Blog, Exchange Online, Microsoft 365, Powershell
0
ADVERTISEMENT

Table of Contents

When sending emails from various applications or scripts, you may encounter error 5.7.3 StartTLS is Required to Send Email. You may face this error in different apps (SQL Server, Jenkins), scripts, and programming languages (Visual Basic, PowerShell, Python, Java, C#).

Send-MailMessage `
    -To "[email protected]" -From "[email protected]" `
    -Subject "This is a test message from PowerShell" `
    -Body "Hello World!" `
    -Credential $Cred `
    -SmtpServer "smtp.office365.com" -Port 587

In our case, we saw an error Send-MailMessage : Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [DM6PR06CA0054.namprd06.prod.outlook.com] when we are sending an email from Exchange Online (Microsoft 365):

Send-MailMessage : Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail
[DM6PR06CA0054.namprd06.prod.outlook.com]

At line:1 char:1
+ Send-MailMessage `
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient), SmtpException
+ FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage.

The Server Response was 5.7.3 STARTTLS is Required to Send Mail

What Does the StartTLS is Required Error Mean?

StartTLS is an extension of the SMTP protocol that allows telling the email server that the email client wants to use a secure connection using TLS or SSL. When using STARTTLS, an encrypted connection is created right on top of a usual TCP connection instead of opening a separate port for encrypted connections. The StartTLS command is used by both SMTP and IMAP (POP3 uses a different STLS command for encryption).

In order to check that your email server supports StartTLS, open a command prompt and connect to it using telnet command.

telnet smtp.office365.com 587

In this example, the client has requested (EHLO) a list of features that the email server supports, and the server has returned that it can use STARTTLS: 250-STARTTLS.

250-SG2PR02CA0114.outlook.office365.com Hello [2405:4802:336:17e0:4037:bbbc:534e:a14a]
250-SIZE 157286400
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 SMTPUTF8

Most SMTP servers implement STARTTLS only on port 587. Some servers (like Gmail) also allow to use STARTTLS on default SMTP port 25.

5.7.3 STARTTLS is Required to Send Mail PowerShell

In this case, you must add the parameter to connect to the SMTP server using the SSL protocol.
Send-MailMessage `
    -To "[email protected]" -From "[email protected]" `
    -Subject "This is a test message from PowerShell" `
    -Body "Hello World!" `
    -Credential $Cred `
    -SmtpServer "smtp.office365.com" -Port 587 `
    -UseSsl

As you can see, the error was gone, and the email was sent to admin’s mailbox.

The Server Response was 5.7.3 STARTTLS is Required to Send Mail
The Server Response was 5.7.3 STARTTLS is Required to Send Mail
ADVERTISEMENT
5/5 - (1 vote)
Previous Post

How to Create an App Password in Microsoft 365

Next Post

Send-MailMessage Unable to Read Data From the Transport Connection

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory