Skip to content

Instantly share code, notes, and snippets.

@teeparham
Created February 11, 2011 21:57
Show Gist options
  • Save teeparham/823124 to your computer and use it in GitHub Desktop.
Save teeparham/823124 to your computer and use it in GitHub Desktop.
AWS SES - with display from
gem install aws-ses
# in irb:
require 'aws/ses'
ses = AWS::SES::Base.new :access_key_id => "your-key",
:secret_access_key => "your-secret-key"
ses.addresses.list.result
=> []
ses.addresses.verify 'test@example.com'
# check your email & confirm
ses.addresses.list.result
=> ["test@example.com"]
ses.send_email :to => 'someone@example.com',
:source => 'test@example.com',
:subject => 'from SES',
:text_body => 'this is a test'
# now let's use a nice from address
ses.send_email :to => 'someone@example.com',
:source => '"John Smith" <test@example.com>',
:subject => 'from SES',
:text_body => 'this is a test'
# it works! check your email from "John Smith"
=> #<AWS::SES::SendEmailResponse:0x2155502760 200 OK>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment