What is AWS SES
SES stands for Simple Email Server, is a platform that allows sending and receiving email using email or domain
Used for sending marketing emails, notification emails in the system such as registration, newsletter, order info ..
Pricing
Refer to AWS SES pricing here https://aws.amazon.com/ses/pricing/
Prices depend on the region you choose, with the price as above, you can freely test and worry about being charged
If you deploy the application to EC2 (including Free Usage Tier) and send mail from there using SES, you can send up to 62k emails without charge
Compatible with other AWS services
- Email from EC2 using AWS SDK
- Compatible with AWS Elastic Beanstalk
- Set up SNS to notify whether emails are not sent or have been successfully sent to the recipients
- Control users’ access to email sending by IAM
- Host email on S3 service
- Email trigger using AWS Lambda
- Put sending email event to Amazon Cloudwatch
Send email from EC2 and SES applications
The first thing to use SES or any AWS service is that you need an AWS account. Refer here https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sign-up-for-aws.html
Create a smtp setting
- Access to ses service select region
- Select SMTP settings
- And click the create button “Create my SMTP credential” button
- SES will create an IAM user for authenticate, to default to click create
- Get the credential information from the csv file you got from step 2 fill in the smtp settings in your application
1 2 3 4 5 6 7 8 9 | config.action_mailer.smtp_settings = { :address => ENV["ADD"], :port => ENV["PORT"],# 587 :user_name => ENV["USER_NAME"], :password => ENV["PASSWORD"], :authentication => 'login', :enable_starttls_auto => true } |
To send an email you need to setup and validate an email
Verify email
- Access SES service
- Click Email Address menu
- Click Verify new email button, enter your email address
- An AWS SES message will send you an email confirmation for authentication, go to the mail box and click on the confirm link
- After clicking on the confirmation email link that AWS sends you your email will be verified
So the installation steps have been completed, your application is ready to send email to anywhere with the sender as the email you have just verified.
Sanbox limitation
By default, your SES service account will be in Sandbox mode and your sandbox account is limited
- Sending quota: 200 emails / day
- Max send rate: 1 email / s
To send more emails you need to request out of the sandbox into the product environment
Detail https://docs.aws.amazon.com/ses/latest/DeveloperGuide/request-production-access.html
Refer
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/Welcome.html