You will want to use AWS SES via SMTP when you're launching an app that sends out emails of any kind (user registrations, email notifications, etc). For example, I have used this configuration on various Ruby on Rails apps, but it's basic SMTP configuration.
There are two ways to go about this:
- EASY WAY: Create an SMTP user via AWS SES [http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html#smtp-credentials-console]
- NOT SO EASY WAY: Create an SMTP password for an existing IAM user
Luckily, you found these MD files and the NOT SO EASY WAY is suddenly copy-pasta. sudo yum....
Assuming you've already set up your SES Policy on your IAM User:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect":"Allow",
"Action":["ses:SendEmail", "ses:SendRawEmail"],
"Resource":"*"
}
]
}
Go ahead and drop this into an bash session and pass in your IAM user's secret key to get back your SMTP password :)
require 'openssl'
require 'base64'
def aws_iam_smtp_password_generator(secret)
message = "SendRawEmail"
versionInBytes = "\x02"
signatureInBytes = OpenSSL::HMAC.digest('sha256', secret, message)
signatureAndVer = versionInBytes + signatureInBytes
smtpPassword = Base64.encode64(signatureAndVer)
end
<?php
function aws_iam_smtp_password_generator($secret) {
$message = "SendRawEmail";
$versionInBytes = chr(2);
$signatureInBytes = hash_hmac('sha256', $message, $secret, true);
$signatureAndVer = $versionInBytes.$signatureInBytes;
$smtpPassword = base64_encode($signatureAndVer);
return $smtpPassword;
}
?> # TODOI'm not a Java programmer, yet, but AWS's documentation [http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-credentials.html#smtp-credentials-convert] has a snippet you can use