ssl issue triggering email.

Roger Roger 4,951 Reputation points
2022-04-21T13:08:07.307+00:00

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.

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,173 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,345 questions
Microsoft Exchange Hybrid Management
Microsoft Exchange Hybrid Management
Microsoft Exchange: Microsoft messaging and collaboration software.Hybrid Management: Organizing, handling, directing or controlling hybrid deployments.
1,884 questions
{count} votes

Accepted answer
  1. KyleXu-MSFT 26,206 Reputation points
    2022-04-22T01:40:06.38+00:00

    @Roger Roger

    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.


    0 comments No comments

0 additional answers

Sort by: Most helpful