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?