I am using sendmailR
to send emails from R. Does any one know what needs to be used to be able to attach more than one file?
This is the code that I have been using for a single attachment, but I don’t know how to adjust it for more than one file:
library(sendmailR)
from <- "......org"
to <- c("Pegah@...net")
subject <- "Daily Report"
body <- "Attached is today's Daily Report"
mailControl = list(smtpServer=".....net")
attachmentPath <- paste0("/Rate and Lab Counts ", Sys.Date(), ".png")
attachmentObject <- mime_part(x=attachmentPath, name=attachmentName)
bodyWithAttachment <- list(body,attachmentObject)
sendmail(from=from, to=to, subject=subject, msg=bodyWithAttachment, control=mailControl)