I'm trying to run sendmailR on Windows with the following code:
## Not run:
from <- "<tal.galili@gmail.com>" # sprintf("<sendmailR@\\%s>", Sys.info()[4])
to <- "<tal.galili@gmail.com>"
subject <- "Hello from R"
body <- list("It works!", mime_part(iris))
sendmail(from, to, subject, body,
control=list(smtpServer="ASPMX.L.GOOGLE.COM."))
And get the following error:
Error in socketConnection(host = server, port = port, blocking = TRUE) :
cannot open the connection
In addition: Warning message:
In socketConnection(host = server, port = port, blocking = TRUE) :
smtp.gmail.com tal.galili@gmail.com:statisfun:25 cannot be opened
The answer here give a solution for Linux, and I would be grateful for advice for Windows users.
Thanks.
Any time that sendmailR fails to authenticate, one gets the not so helpful message that
This can be for many reasons, including server side reasons. In my case, I needed to put my IP on the server's whitelist. @alko989 declares at issue using sendemailR that
authentication ... is not supported by sendmailR
, and as of the 2015-Feb-20 publishing of sendmailR https://cran.r-project.org/web/packages/sendmailR/sendmailR.pdf, the only control parameters aresmtpServer
,smtpPort
&verbose
, so nothing for user, password, ssl, tls, etc. Mail servers today tend to be much more secure than the mail servers of the past, so that's a serious limitation of sendmailR.As an alternative to using sendmailR you might try this:
Parse together a VB-Script (see e.g. http://www.paulsadowski.com/wsh/cdo.htm ) and then call it via shell.
This might look like this:
... and use it like this:
You could give the new mailR package a shot: http://cran.r-project.org/web/packages/mailR/index.html
The following call should then work:
I used to send emails via R using these lines.
Suppose your email is
tal.galili@gmail.com
using window OS (my operation system)