从R发送电子邮件,身体为整数或列表

时间:2015-11-19 07:24:05

标签: r email sendmailr

finlist <- 1:10

library(mailR)
sender <- "SENDER@gmail.com"
recipients <- c("Recipent@gmail.com")
send.mail(from = sender,
to = recipients,
subject="From R",
body = finlist,
smtp = list(host.name = "smtp.gmail.com", port = 465,
user.name="SENDER@gmail.com", passwd="Password", ssl=TRUE),
authenticate = TRUE,
send = TRUE)

以上内容应发送电子邮件,主题为1,2,3,... 10。 但是收到以下错误。

  

file.exists(正文)出错:无效&#39;文件&#39;参数

1 个答案:

答案 0 :(得分:1)

body =paste(finlist, collapse = ",")