【发布时间】:2020-05-23 10:55:14
【问题描述】:
我正在尝试使用包 emayili 发送电子邮件,我需要附加一个 html 文件。代码运行良好,我收到了电子邮件,但文件从未附加。我一直在搜索和更改我的代码,但它总是死路一条。
这是我的代码:
email <- envelope() %>%
from("1234@gmail.com") %>%
to("1234@gmail.com") %>%
subject("subject") %>%
body("text")
files<-xml2::read_html(paste("D:/path/file",".html",sep=""))
email <- email %>% attachment(files)
smtp <- server(host = "smtp.gmail.com",
port = 465,
username = "1234@gmail.com",
password = "pass")
smtp(email, verbose = TRUE)
也试过
email <- email %>% attachment(read_html(paste("D:/path/file",".html",sep="")))
还有其他几件事......
有什么建议吗? 感谢您的宝贵时间
【问题讨论】:
标签: html email rstudio attachment