How to Create & Configure Simple Email Service on Amazon Web Service(AWS).
Amazon Simple Email Service (SES) is a cloud-based email service that provides cost-effective, flexible and scalable way for businesses of all sizes to keep in contact with their customers through email.
Amazon SES customers send up to hundreds of millions of emails a day. In the last year alone, SES send over 500B emails on behalf of customers across the globe.
- Login to aws portal.
- Click on Services.
- Under Business Applications select Amazon Simple Email Service.
- Click on Create Identity.
- Select Identity Type:Domain or Email address. A verified identity is a domain name or email address that is used for sending email via Amazon SES.
- Provide Email address.
- Provide Tag key name & value.
- Click on Create Identity.
- Once Amazon SES created successfully.We get a confirmation link on verified email address. Click on Confirmation link.
- After click on confirmation link, Amazon SES identity status is verified.
- Click on Send Test Email.
- Select Email Format:formatted or Raw. Formatted means send a simple message. Raw means send a complex message such as HTML or attachment.
- Click on Scenario.
- Select Custom Scenario.
- Provide Custom Recipient Email address.
- Provide Subject.
- Type to Body(Content) of Message.
- Click on Send Test Email.
- Successfully Sent a email to custom recipient.
Create Simple Email Service using Shell
- Setup aws-cli on your system so click on link https://www.hackerxone.com/blog/how-install-configure-aws-cli-ubuntu-1804
- Run the following command:
To create a identity
aws create-email-identity –email-identity <value> –tags <value>
To verify an email address with Amazon SES
aws ses verify-email-identity –email-address [email protected]
To send a formatted email using Amazon SES
aws ses send-email –from [email protected] –destination /path/of/destination.json –message /path/of/message.json
The destination.json file is given below:
{
“ToAddresses”: [“[email protected]”, “[email protected]”],
“CcAddresses”: [“[email protected]”],
“BccAddresses”: []
}
The message.json file is given below:
{
“Subject”: {
“Data”: “Test email sent using the AWS CLI”,
“Charset”: “UTF-8”
},
“Body”: {
“Text”: {
“Data”: “This is the message body in text format.”,
“Charset”: “UTF-8”
},
“Html”: {
“Data”: “Example”,
“Charset”: “UTF-8”
}
}
}