Send email with Amazon Simple Email Service

Tram Ho

Amazon Simple Email Service (Amazon SES) is an extremely flexible and cost-effective service for sending and receiving email. Amazon SES eliminates the complexity and cost of building an internal email solution or licensing, installing and operating a third-party email solution.

1. Introduction to Amazon SES.

Amazon Simple Email Service (Amazon SES) is a cloud-based email service designed to help digital marketing professionals and application developers send email marketing, notifications and deals. This is a reliable, cost-effective service for businesses of all sizes to use email to stay in touch with their customers.

You can use the SMTP interface or one of the AWS SDKs to integrate Amazon SES directly into your existing applications. You can also integrate the email delivery feature of Amazon SES into the site you are using.

2. Config and use.

  1. Go to the service ses page of amazon. And look for Simple email service.
  2. Click Email Address and verify email 2 emails to send and receive. Note to use the correct email because amazon will send an email to confirm.

Add config

Here I use aws-sdk. gem_file

create config / initalizes / amazon_aws.rb

In the previous post I have instructions for creating an IAM user, Now I just need to go to that group_ad user and add AmazonSESFullAccess permission for that group. create config / initalizes / amazon_ses.rb

setting.yml

Next is the email section.

In application_mailer I will define some methods to send email using amazon service.

Create UserMailer

send_mail_demo.text.erb

Test send email

I will send to the verified address above.

and email received

You can refer to some other methods of aws sdk ses here

Source code github

Share the news now

Source : Viblo