使用“从R发送电子邮件”;sendmailR";具有超过1个附件

使用“从R发送电子邮件”;sendmailR";具有超过1个附件,r,sendmailr,R,Sendmailr,我正在使用sendmailR从R发送电子邮件。有人知道需要使用什么才能附加多个文件吗 这是我在单个附件中使用的代码,但我不知道如何对多个文件进行调整: 库(sendmailR) fromsendmailr支持多个附件;看看这是否解决了您的问题(例如ref): 库(sendmailR) 从…起 library(sendmailR) from <- "......org" to <- c("Pegah@...net") subject <-

我正在使用
sendmailR
从R发送电子邮件。有人知道需要使用什么才能附加多个文件吗

这是我在单个附件中使用的代码,但我不知道如何对多个文件进行调整:

库(sendmailR)

from
sendmailr
支持多个附件;看看这是否解决了您的问题(例如ref):

库(sendmailR)
从…起
library(sendmailR)
from <- "......org"
to <- c("Pegah@...net")
subject <- "Daily Report"
body <- "Attached is today's Daily Report"
mailControl=list(smtpServer=".....net")
attachmentPath_1 <- paste0("/Rate and Lab Counts ", Sys.Date(), ".png")
attachmentPath_2 <- paste0("/Percent change over time ", Sys.Date(), ".png")
attachmentPath_etc <- paste0("/Frequency trend data etc ", Sys.Date(), ".png")
attachmentObject_1 <- mime_part(x=attachmentPath_1, name=attachmentName_1)
attachmentObject_2 <- mime_part(x=attachmentPath_2, name=attachmentName_2)
attachmentObject_etc <- mime_part(x=attachmentPath_etc, name=attachmentName_3)
bodyWithAttachment <- list(body, attachmentObject_1, attachmentObject_2, attachmentObject_etc)
sendmail(from=from, to=to, subject=subject, msg=bodyWithAttachment, control=mailControl)