如何在R中发送HTML格式的电子邮件,而不需要Java?
mailR包不再可用,因为它依赖于Java。有哪些替代方案?
注意:下面的代码在mailR中运行良好,并尝试复制相同的代码。
send.mail(from = fromEmailAddress,
to = mailTo,
subject = subjectDetailed ,
body = bodyToSend,
html = TRUE,
smtp = list(host.name = hostname, port = 25),
send = TRUE
)
囊胚,Microsoft365R有几个很棒的HTML邮件包,也支持Rmarkdown报告邮件
(囊胚)https://github.com/rstudio/blastula
[Microsoft365R]https://github.com/Azure/Microsoft365R
以下作品
library(sendmailR)
msg = mime_part(bodyToSend)
msg[["headers"]][["Content-Type"]] = "text/html"
sendmail(mailFrom,mailTo,subject, msg, control=list(smtpServer= "smtpserver"))