Support for TLS in SMTP server
Closed this issue · 2 comments
clowg commented
Is your script able to support TLS for the SMTP server?
I want to send via smtp.office365.com and that gives this error:
10/07/2023 17:11:32 - [ERROR] Send-MailMessage : Error in processing. The server response was: 5.7.3 STARTTLS is required to send mail [SYBPR01CA0209.ausprd01.prod.outlook.com
2023-07-10T05:11:31.967Z 08DB7C994F8AAD26]
At C:\Reports\BR-MorningReport.ps1:225 char:5
+ Send-MailMessage -From $mail_From `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpException
+ FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage
carceneaux commented
clowg commented
Thanks for the hint.
Got it all working using stored credentials and SSL.