Avatar of Varshini S
Varshini S
 asked on

unable to send email from powershell script

$users = "test@live.com" # Users to be notified
 
$fromemail = "test@live.com" # From Email
 
$server = "smtp.live.com" #SMTP Server information

------------
--------
send-mailmessage -from $fromemail -to $users -subject "CPU Utilization Monitoring Alert" -BodyAsHTML -body $HTMLmessage -priority High -smtpServer $server

I am getting below exception:


send-mailmessage : The SMTP server requires a secure connection or the client was not authenticated. The server
response was: 5.7.0 Must issue a STARTTLS command first
Powershell* SMTP

Avatar of undefined
Last Comment
Chris Dent

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Chris Dent

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy