我正在尝试sendmailR
使用以下代码使用包从 R 发送电子邮件,但不幸的是失败了:
## Set mail contents
from <- sprintf('<sendmailR@%s>', Sys.info()[4])
to <- '<slackline@gmail.com>'
subject <- 'Feeding Plots'
body <- list('Latest feeding graph', mime_part(feeding.plot,
name = "feeding"))
## Set control parameters
control <- sendmail_options(verboseShow = TRUE,
smtpServer ="smtp.gmail.com",
smtpPort = 587,
smtpSTARTTLS = '',
blocking = FALSE)
sendmail(from,
to,
subject,
msg = body,
control = control,
headers)
<< 220 mx.google.com ESMTP xt1sm884721wjb.17 - gsmtp
>> HELO kimura
<< 250 mx.google.com at your service
>> MAIL FROM: <sendmailR@kimura>
<< 530 5.7.0 Must issue a STARTTLS command first. xt1sm884721wjb.17 - gsmtp
Error in wait_for(code) :
SMTP Error: 5.7.0 Must issue a STARTTLS command first. xt1sm884721wjb.17 - gsmtp
sendmailR 手册没有提到如何配置,尽管STARTTLS
它确实表明可以传递其他参数,这就是为什么我根据其他一些线程( here和here)smtpSTARTLS = ''
中提到的内容包含了该选项。我尝试过使用 for 的参数并将其设置为但没有乐趣。smtpSTARTTLS
TRUE
任何指向文档或解决方案的指针都将受到欢迎。
谢谢