我有包含电子邮件的 CSV 文件。
如何在 r 中发送多封电子邮件?
错误1
send.mail 函数不采用 data.frame 值
Error in FUN(X[[i]], ...) :
Sorry, parameter type `NA' is ambiguous or not supported.
错误2
函数不从 read.table 获取输入
Error in file.exists(body) : invalid 'file' argument
我的代码如下(凭证仅作为示例)
temp <- read.csv("E:/OneDrive/M.Tech/temp.csv",header = FALSE)
m <- data.frame(temp)
email <- m[2,14]
rollno <- m[2,1]
file <- read.table("C:/Mehul Katara/New folder (2)/131004.txt",header = TRUE,sep = ";")
send.mail(from = "[email protected] /cdn-cgi/l/email-protection",
to = email,
subject = rollno,
body = file,
smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "[email protected] /cdn-cgi/l/email-protection", passwd = "password", ssl = TRUE),
authenticate = TRUE,
send = TRUE)