These functions create a MIME message. They can be created atomically using
gm_mime() or iteratively using the various accessors.
gm_mime(..., attr = NULL, body = NULL, parts = list())
# S3 method for class 'mime'
gm_to(x, val, ...)
# S3 method for class 'mime'
gm_from(x, val, ...)
# S3 method for class 'mime'
gm_cc(x, val, ...)
# S3 method for class 'mime'
gm_bcc(x, val, ...)
# S3 method for class 'mime'
gm_subject(x, val, ...)
gm_text_body(
mime,
body,
content_type = "text/plain",
charset = "utf-8",
encoding = "quoted-printable",
format = "flowed",
...
)
gm_html_body(
mime,
body,
content_type = "text/html",
charset = "utf-8",
encoding = "base64",
...
)
gm_attach_part(mime, part, id = NULL, ...)
gm_attach_file(mime, filename, type = NULL, id = NULL, ...)additional parameters to put in the attr field
attributes to pass to the message
Message body.
mime parts to pass to the message
the object whose fields you are setting
the value to set, can be a vector, in which case the values will be joined by ", ".
message.
The content type to use for the body.
The character set to use for the body.
The transfer encoding to use for the body.
The mime format to use for the body.
Message part to attach
The content ID of the attachment
name of file to attach
mime type of the attached file
# using the field functions
msg <- gm_mime() |>
gm_from("james.f.hester@gmail.com") |>
gm_to("asdf@asdf.com") |>
gm_text_body("Test Message")
# alternatively you can set the fields using gm_mime(), however you have
# to use properly formatted MIME names
msg <- gm_mime(
From = "james.f.hester@gmail.com",
To = "asdf@asdf.com"
) |>
gm_html_body("<b>Test<\b> Message")