Hi All
I am trying to trigger a test email using the below syntax i am getting error. if i am using onprem relay i am not seeing any issue if i use office365 relay i am facing issue. exchange online plan1 license is assigned to the service account. sender and recipient email is my domain.
Send-MailMessage -SmtpServer smtp.office365.com -Credential $credential -From 'svcacct@contoso.com' -To 'user1@contoso.com' -Subject 'Test' -Port 587 -UseSsl STARTTLS
Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 Client not authenticated to send mail.
Error: 535 5.7.139 Authentication unsuccessful, the user credentials were incorrect.