- last edited on
I'm trying to send email with powershell, I'm stuck on the authentication. Here's what I have so far
Send-MailMessage -To firstname.lastname@example.org -from email@example.com -Subject Test -SmtpServer "smtp.broadband.rogers.com"
It always tell me that
Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Authentication required
I tried to add -credential using my from@progers + email password or even used my roger account without much luck.
Thanks in advance
Solved! Go to Solution.
Rogers internet requires authentication and SSL.So in your powershell send string, you will need to indicate your credentials, as well as the use SSL flag.
Send-MailMessage -From FROM@Rogers.com -to firstname.lastname@example.org -Subject SUBJECT
-Body BODY -SmtpServer smtp.broadband.rogers.com -port 465 -UseSsl
The only problem is.. that i know of.. is the credential part, is only a GET capable flag.. you cant put an actuall value.. it has to get at the time of the script run..
So makes it a little hard to automate it 😞 (if thats your intention)
View solution in original post
Welcome to the Community Forums!
You've come to the right to get assistance with your concern.
This might be something one of our Resident Experts @Gdkitty @Datalink might be able to assist with?
Could try passing a PSCredential variable in script
$cred=New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "MyUserID", ("MyPassword" | ConvertTo-SecureString)