Module: AWS::SES::SendEmail
- Included in:
- Base
- Defined in:
- lib/aws/ses/send_email.rb
Overview
Adds functionality for send_email and send_raw_email Use the following to send an e-mail:
ses = AWS::SES::Base.new( ... connection info ... )
ses.send_email :to => ['[email protected]', '[email protected]'],
:source => '[email protected]',
:subject => 'Subject Line'
:text_body => 'Internal text body'
Instance Method Summary collapse
-
#send_email(options = {}) ⇒ Response
Sends an email through SES.
Instance Method Details
#send_email(options = {}) ⇒ Response
Sends an email through SES
the destination parameters can be:
- A single e-mail string
- A array of e-mail addresses
“Email address is not verified.MessageRejected (AWS::Error)”
If you are receiving this message and you HAVE verified the [source] please check to be sure you are not in sandbox mode! If you have not been granted production access, you will have to <b>verify all recipients</b as well. docs.amazonwebservices.com/ses/2010-12-01/DeveloperGuide/index.html?InitialSetup.Customer.html
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/aws/ses/send_email.rb', line 39 def send_email( = {}) package = {} package['Source'] = [:source] || [:from] add_array_to_hash!(package, 'Destination.ToAddresses', [:to]) if [:to] add_array_to_hash!(package, 'Destination.CcAddresses', [:cc]) if [:cc] add_array_to_hash!(package, 'Destination.BccAddresses', [:bcc]) if [:bcc] package['Message.Subject.Data'] = [:subject] package['Message.Body.Html.Data'] = [:html_body] if [:html_body] package['Message.Body.Text.Data'] = [:text_body] || [:body] if [:text_body] || [:body] package['ReturnPath'] = [:return_path] if [:return_path] request('SendEmail', package) end |