Skip to content

Instantly share code, notes, and snippets.

@DevOps-Dad
Created February 6, 2019 16:54
Show Gist options
  • Save DevOps-Dad/1de40c85dc94b750cbdb4de902b51e08 to your computer and use it in GitHub Desktop.
Save DevOps-Dad/1de40c85dc94b750cbdb4de902b51e08 to your computer and use it in GitHub Desktop.

Revisions

  1. DevOps-Dad created this gist Feb 6, 2019.
    14 changes: 14 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    $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"