Created
February 11, 2011 21:57
-
-
Save teeparham/823124 to your computer and use it in GitHub Desktop.
AWS SES - with display from
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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