从 R 发送电子邮件,正文为整数或列表
Send Email from R with body as integers or list
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 的电子邮件。
但是收到以下错误。
Error in file.exists(body) : invalid 'file' argument
尝试
body =paste(finlist, collapse = ",")
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 的电子邮件。 但是收到以下错误。
Error in file.exists(body) : invalid 'file' argument
尝试
body =paste(finlist, collapse = ",")