library(rmarkdown)
render("**.Rmd","html_document", encoding = "utf-8")
library(mailR)
sender <- "**@sina.com"
recipients <- c("**@qq.com")
email <- send.mail(
from = sender,
to = recipients,
subject="测试邮件",
body = "**.html",
encoding = "utf-8",
html = TRUE,
smtp = list(
host.name = "smtp.sina.com",
user.name = "**@sina.com",
passwd = "***",
port = 25
),
authenticate = TRUE,
send = TRUE
)
附错误信息如下:
Warning message:
In readChar(body, file.info(body)$size) :
can only read in bytes in a non-UTF-8 MBCS locale