SES, a simple email service, is one of the many services provided by Amazons Web Services. It is precisely what the name says a simple email system that one can use to relay mail. SES is used in many situations. One that we often find it used for is sending from a website form, often with one plugin or a snippet of code. With either method, there are times when something goes wrong, and you need a way to test. If that is where you’re at, here are some solutions to test SES.
To run the test below, you must have SES set up in your AWS account. If you have not done this, you must add and verify the domain. You will need to create your SMTP credentials. While doing this, save the info, as this is the only time you can get it. When you have completed these tasks, you can begin using SES.
If you’re using a windows OS, you can use the following line as a PowerShell script. Please copy the text below into your text editor, save it as a .ps1 file, and then run it from PowerShell. Of course, you must add your own from, to, subject, and keys.
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
As always, if you run into issues using SES or any other AWS product, we are here to help and provide a solution.