繁体   English   中英

如何避免在 R 中使用 sendmail 时出现“msg”丢失的错误?

[英]How to avoid `"msg" is missing` error using sendmail in R?

当我尝试使用来自 R 中的sendmail package 的sendmailR时,出现此错误:

Error in .smtp_submit_mail(server, port, headers, msg, verbose) : argument "msg" is missing, with no default

这是我要执行的代码:

library(sendmailR)
from <- "<some.address@gmail.com>"
to <- "<some.address@gmail.com>"
subject <- "this subject"
body <- "this text right here"
mailControl <- list(smtpServer = "ASPMX.L.GOOGLE.COM")
sendmail(from = from, to = to, subject = subject,
                  body = body, control = mailControl)

这基本上与可以在在线教程中找到的代码相同。

email 的正文参数称为msg ,而不是body 采用

sendmail(from = from, to = to, subject = subject,
                  msg = body, control = mailControl)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM