Skip to content

Instantly share code, notes, and snippets.

@jorke
Created October 8, 2013 03:53
Show Gist options
  • Save jorke/6879224 to your computer and use it in GitHub Desktop.
Save jorke/6879224 to your computer and use it in GitHub Desktop.
Send email via AWS SES using powershell one liner.
Send-MailMessage -From <from> -to <to> -subject <subject> -SmtpServer email-smtp.us-east-1.amazonaws.com -Credential
$(New-Object System.Management.Automation.PSCredential -argumentlist <AWS_ACCESS_KEY>,
$(ConvertTo-SecureString -AsPlainText -String <AWS_SECRET_KEY> -Force)
)
-UseSsl -Port 587
@alvarezallin
Copy link

@DanielAdeniji create the SMTP credentials (access/secret key) from the SES console (instead of IAM). https://docs.aws.amazon.com/ses/latest/dg/smtp-credentials.html

@misterersonn
Copy link

Friends :-

Here is the error I am getting.

Send-MailMessage : The SMTP server requires a secure connection or the client was not authenticated. The server
response was: Authentication required.

Are there means of debugging further.

@DanielAdeniji hello do you find solution for that ? i have same error

@rt-solutions
Copy link

@misterersonn Same thing here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment