troubleshooting Question

unable to send email from powershell script

Avatar of Varshini S
Varshini S asked on
Powershell* SMTP
1 Comment1 Solution174 ViewsLast Modified:
$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
ASKER CERTIFIED SOLUTION
Chris Dent
PowerShell Developer
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros