question

RogerRoger-2394 avatar image
0 Votes"
RogerRoger-2394 asked KyleXu-MSFT edited

ssl issue triggering email.

Hi All

I am using exchange 2016 hybrid environment. I am trying to trigger a test email from PowerShell using onprem relay. i am getting the below error.

 Send-MailMessage -SmtpServer mrfa.contoso.com.com -Credential $credential -From 'serviceaccount@contoso.com' -To 'myuser@contoso.com' -Subject 'TEST' -Port 587 -UseSsl

Send-MailMessage : Authentication failed because the remote party has closed the transport stream.
At line:1 char:1
+ Send-MailMessage -SmtpServer mrfa.contoso.com.com -Credential $c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpException
+ FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage

I am getting emails when i remove -UseSSl. Experts how do i fix the SSL issue.

office-exchange-server-administrationoffice-exchange-online-itprooffice-exchange-server-mailflowoffice-exchange-hybrid-itpro
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@RogerRoger-2394

I am writing here to confirm with you any update about this thread now.
If the suggestion below helps, please feel free to accept it as an answer to help more people.

0 Votes 0 ·

1 Answer

KyleXu-MSFT avatar image
0 Votes"
KyleXu-MSFT answered

@RogerRoger-2394

Mark sure TLS 1.2 is enabled on your server. Here is a related thread: Authentication failed because the remote party has closed the transport stream

Here is a blog which could help you to enable TLS 1.2, choose the suitable one based on your .NET version: Exchange Server TLS guidance Part 2: Enabling TLS 1.2 and Identifying Clients Not Using It


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.