Created
September 18, 2019 13:25
-
-
Save adamhancock/f2eb435c25a898266807b8a2488a2aa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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