Skip to content

Instantly share code, notes, and snippets.

@adamhancock
Created September 18, 2019 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamhancock/f2eb435c25a898266807b8a2488a2aa0 to your computer and use it in GitHub Desktop.
Save adamhancock/f2eb435c25a898266807b8a2488a2aa0 to your computer and use it in GitHub Desktop.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$From = "EmailAddress@gmail.com"
$To = "SomeOtherAddress@whatever.com"
$Cc = "AThirdUser@somewhere.com"
$Subject = "Here's the Email Subject"
$Body = "This is what I want to say"
$SMTPServer = "smtp.gmail.com"
$SMTPPort = "587"
Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl -Credential (Get-Credential) –DeliveryNotificationOption OnSuccess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment