Learn R Programming

aws.ses (version 0.1.4)

send_email: Send Email via SES

Description

Send email via Amazon SES service

Usage

send_email(message, html, raw = NULL, subject, from, to = NULL, cc = NULL, bcc = NULL, replyto = NULL, returnpath = NULL, charset.subject = NULL, charset.message = NULL, charset.html = NULL, ...)
get_quota(...)
get_statistics(...)

Arguments

message
A character string specifying the message body (as plain text). Must specify html, message, or both; or alternatively raw.
html
A character string specifying the message body (as HTML). Must specify html, message, or both; or alternatively raw.
raw
A raw vector containing a valid email body (of no more than 10MB in size). Can only specify raw xor message/html.
subject
A character string specifying the email subject
from
A character string specifying teh sender
to
A character vector of TO recipient email addresses.
cc
A character vector of CC recipient email addresses.
bcc
A character vector of BCC recipient email addresses.
replyto
A character vector of reply-to email addresses.
returnpath
A character string specifying the email address to which feedback and bounces are sent.
charset.subject
An optional character string specifying the character set, e.g., “UTF-8”, “ISO-8859-1”, etc. if subject is not ASCII.
charset.message
An optional character string specifying the character set, e.g., “UTF-8”, “ISO-8859-1”, etc. if message is not ASCII.
charset.html
An optional character string specifying the character set, e.g., “UTF-8”, “ISO-8859-1”, etc. if html is not ASCII.
...
Additional arguments passed to sesPOST.

Value

A character string containg the message ID.

Details

Send a test or raw email message. get_quota and get_statistics provide information on remaining and used email rate limits, respectively.

Examples

Run this code
## Not run: 
# # verify email address
# verify_identity("me@example.com")
# 
# # if email verified, can be used to send a message
# a <- get_verification_attrs("me@example.com")
# if (a[[1]]$VerificationStatus == "Success") {
#   # simple plain-text email
#   send_email("Test Email Body", subject = "Test Email", 
#              from = "me@example.com", to = "recipient@example.com")
# 
#   # html and plain text versions
#   send_email(message = "Plain text body", 
#              html = "<div><p style='font-weight=bold;'>HTML text body</p></div>", 
#              subject = "Test Email", 
#              from = "me@example.com", to = "recipient@example.com")
# }
# ## End(Not run)
## Not run: 
# get_quota()
# get_statistics()
# ## End(Not run) 

Run the code above in your browser using DataLab