Note: if you want to setup SES in a way that scales much better and functions even with non-PHP sites, please read this more recent HowTo: How to configure your Postfix server to relay email through Amazon Simple Email Service (SES)
Here’s how you can start using Amazon’s new SES (Simple Email Service) without having to actually implement it in the php of your website:
- Extract the files and create a new one named “aws-credentials” with your key data in it; for example:
- Verify an email address to use with SES
./ses-verify-email-address.pl -k ./aws-credentials -v [email protected]
- Check the email account for the address you’re verifying and click on the provided link.
- Send a test email:
echo "This is only a test." | ./ses-send-email.pl -k ./aws-credentials -s "test subject for email" -f [email protected] [email protected](Note – Until you receive production access to Amazon SES, you can only send to addresses you have verified. You can request production access here.)
- Edit the sendmail_path config in your php.ini as follows:
sendmail_path = /path/to/ses-send-email.pl -k /path/to/aws-credentials -f [email protected] -r
- Restart/reload Apache and that’s it!
(Additional notes – The “From” address you set in your php.ini file will override any mail headers you set in php. Sending will fail if you try to set the “From” header to an unverified address or when setting the “Reply-To” header at all in php.)