I'm trying to send emails from R using sendmailR
package using the following code, which unfortunately fails :
## 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
The sendmailR manual doesn't mention how to configures STARTTLS
although it does indicate that additional arguments can be passed, which is why I have included the option smtpSTARTLS = ''
based on whats mentioned in some other threads (here and here). I've tried playing with the argument for smtpSTARTTLS
and setting it to TRUE
but no joy.
Any pointers to documentation or solutions would be most welcome.
Thanks