0

我正在尝试使用 sendmailR 在 R 中附加一个文件。

这可能吗?

不包括 attach.files 行发送电子邮件没有问题。

to <- "<me@localhost>"
subject <- "test attachment"
body <- list("test")
attach.files = c("test.jpeg"),
sendmail(from, to, subject, body,
control=list(smtpServer="192.168.0.51"))} 
Error: unexpected '}' in:
"sendmail(from, to, subject, body,
control=list(smtpServer="192.168.0.51"))}"
4

1 回答 1

0

试试下面的代码:

to <- "<me@localhost>"
subject <- "test attachment"
attachment -> mime_part (x = "test.jpeg")
body <- list("test", attachment)
sendmail(from, to, subject, body,
control=list(smtpServer="192.168.0.51"))} 
于 2020-12-22T17:36:58.267 回答