1、library(mailR)
#body正文
body = "this is a test"
#收件人
recipients <- c("[email protected]", "[email protected]")
#发件人
sender = "[email protected]"
#主题
title = "this is title"
#填上邮箱密码code,如body是html,设置body=html参数,那么发出来的正文就是html格式的了
---------------------
作者:small_farmer
来源:CSDN
原文:https://blog.csdn.net/small_farmer/article/details/52713795
版权声明:本文为博主原创文章,转载请附上博文链接!

2、send.mail(
from = sender,
to = recipients,
subject = title,
body = html,
encoding = "utf-8",
html = TRUE,
smtp = list(
host.name = "smtp.qq.com",
port = 587,
user.name = sender,
passwd = "code",
ssl = TRUE
),
authenticate = TRUE,
send = TRUE
)
