Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Send-Mail Message Office365 "The remote certificate is invalid according to the validation procedure."

$
0
0

Hi,

Im trying to send a mail message thrugh Office365. I have read that it should work with Send-MailMessage:

Send-MailMessage -Body "Test" -BodyAsHtml -From "..." -To "..." -SmtpServer "smtp.office365.com" -Port 587 -Subject "Montly User Report" -Credential $ocred -UseSsl

But it throws an error on some machines, not all:

Send-MailMessage : The remote certificate is invalid according to the validation procedure.
At line:1 char:1
+ Send-MailMessage -Body "Test" -BodyAsHtml -From "... ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], AuthenticationExcepti
   on
    + FullyQualifiedErrorId : AuthenticationException,Microsoft.PowerShell.Commands.SendMailMessage

Any ideas?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>