Method: AWS::SimpleEmailService#send_raw_email
- Defined in:
- lib/aws/simple_email_service.rb
#send_raw_email(raw_message, options = {}) ⇒ nil Also known as: deliver, deliver!
Sends a raw email (email message, with header and content specified). Useful for sending multipart MIME emails. The raw text of the message must comply with Internet email standards; otherwise, the message cannot be sent.
raw = "Date: Wed, 1 Jun 2011 09:13:07 -0700\nSubject: A Sample Email\nFrom: \"John Doe\" <[email protected]>\nTo: \"Jane Doe\" <[email protected]>\nAccept-Language: en-US\nContent-Language: en-US\nContent-Type: text/plain; charset=\"utf-8\"\nContent-Transfer-Encoding: base64\nMIME-Version: 1.0\n\nc2FtcGxlIHRleHQNCg==\n"
ses.send_raw_email(raw)
Amazon SES has a limit on the total number of recipients per message: The combined number of To:, CC: and BCC: email addresses cannot exceed 50. If you need to send an email message to a larger audience, you can divide your recipient list into groups of 50 or fewer, and then call Amazon SES repeatedly to send the message to each group.
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/aws/simple_email_service.rb', line 333 def send_raw_email , = {} send_opts = {} send_opts[:raw_message] = {} send_opts[:raw_message][:data] = .to_s send_opts[:source] = [:from] if [:from] if .respond_to?(:destinations) send_opts[:destinations] = .destinations end send_opts[:destinations] = [[:to]].flatten if [:to] client.send_raw_email(send_opts) nil end |