Created
February 6, 2019 16:54
-
-
Save DevOps-Dad/1de40c85dc94b750cbdb4de902b51e08 to your computer and use it in GitHub Desktop.
Powershell Send-MailMessage to AWS SES
This file contains hidden or 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
| $AWS_ACCESS_KEY = "RealAccessKeyRightHere" | |
| $AWS_SECRET_KEY = "TotallyRealSecretKeyRightHere" | |
| $SECURE_KEY = $(ConvertTo-SecureString -AsPlainText -String $AWS_SECRET_KEY -Force) | |
| $creds = $(New-Object System.Management.Automation.PSCredential ($AWS_ACCESS_KEY, $SECURE_KEY)) | |
| $from = "[email protected]" | |
| $to = "[email protected]" | |
| $subject = "Test SES Message" | |
| $body = "Just testing that my AWS SES parameters are correct" | |
| Write-Host "Sending Email via AmazonSES" | |
| Send-MailMessage -From $from -To $to -Subject $subject -Body $body -SmtpServer email-smtp.us-east-1.amazonaws.com -Credential $creds -UseSsl -Port 587 | |
| Write-Host "Sent" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment