attachment {emayili} | R Documentation |
Add attachments to a message object
Description
Add attachments to a message object
Usage
attachment(
msg,
path,
name = NA,
type = NA,
cid = NA,
disposition = "attachment"
)
Arguments
msg |
A message object. |
path |
Path to file. |
name |
Name to be used for attachment (defaults to base name of |
type |
MIME type or NA, which will result in a guess based on file extension. |
cid |
Content-ID or |
disposition |
How is attachment to be presented ( |
Value
A message object.
Examples
path_mtcars <- tempfile(fileext = ".csv")
path_scatter <- tempfile(fileext = ".png")
path_cats <- system.file("cats.jpg", package = "emayili")
write.csv(mtcars, path_mtcars)
png(path_scatter)
plot(1:10)
dev.off()
msg <- envelope() %>%
attachment(path_mtcars) %>%
# This attachment will have file name "cats.jpg".
attachment(path_cats, name = "cats.jpg", type = "image/jpeg") %>%
attachment(path_scatter, cid = "scatter")
file.remove(path_scatter, path_mtcars)
[Package emayili version 0.9.1 Index]