This example code should explains what I mean well:
library(blastula)
files <- c(tempfile(fileext = ".txt"), tempfile(fileext = ".txt"))
writeLines("file1", files[1])
writeLines("file2", files[2])
email <- compose_email("test")
out1 <- add_attachment(email, files)$attachments
out2 <- local({
email <- add_attachment(email, files[1])
email <- add_attachment(email, files[2])
email$attachments
})
out1 and out2 should generate the same result. However, at present, smtp_send() will fail when out1 is used for the email argument.
This example code should explains what I mean well:
out1andout2should generate the same result. However, at present,smtp_send()will fail whenout1is used for theemailargument.