gmailr (version 0.7.1)

mime: Create a mime formatted message object

Description

These functions create a MIME message. They can be created atomically using `mime()` or iteratively using the various accessors.

Usage

mime(..., attr = NULL, body = NULL, parts = list())

# S3 method for mime to(x, vals, ...)

# S3 method for mime from(x, val, ...)

# S3 method for mime cc(x, vals, ...)

# S3 method for mime bcc(x, vals, ...)

# S3 method for mime subject(x, val, ...)

text_body(mime, body, ...)

html_body(mime, body, ...)

attach_part(mime, part, ...)

attach_file(mime, filename, type = NULL, ...)

Arguments

...

additional parameters to put in the attr field

attr

attributes to pass to the message

body

Message body.

parts

mime parts to pass to the message

x

the object whose fields you are setting

vals

one or more values to use, will be joined by commas

val

the value to set

mime

message.

part

Message part to attach

filename

name of file to attach

type

mime type of the attached file

Examples

Run this code
# NOT RUN {
# using the field functions
msg = mime() %>%
 from("james.f.hester@gmail.com") %>%
 to("asdf@asdf.com") %>%
 text_body("Test Message")

# alternatively you can set the fields using mime(), however you have
#  to use properly formatted MIME names
msg = mime(From="james.f.hester@gmail.com",
                   To="asdf@asdf.com") %>%
        html_body("<b>Test<\b> Message")
# }

Run the code above in your browser using DataLab