Link to home
Start Free TrialLog in
Avatar of Varshini S
Varshini S

asked on

unable to send email from powershell script

$users = "" # Users to be notified
$fromemail = "" # From Email
$server = "" #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
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial