我试图在Windows上运行sendmailR与以下代码:
- ## 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."))
并得到以下错误:
- Error in socketConnection(host = server,port = port,blocking = TRUE) :
- cannot open the connection
- In addition: Warning message:
- In socketConnection(host = server,blocking = TRUE) :
- smtp.gmail.com tal.galili@gmail.com:statisfun:25 cannot be opened
The answer here为Linux提供了一个解决方案,我将不胜感激Windows用户的建议。
谢谢。
你可以给新的mailR包一个镜头:
http://cran.r-project.org/web/packages/mailR/index.html
接下来的电话应该工作:
- send.mail(from = "tal.galili@gmail.com",to = "tal.galili@gmail.com",subject = "Subject of the email",body = "Body of the email",smtp = list(host.name = "smtp.gmail.com",port = 465,user.name = "tal.galili",passwd = "PASSWORD",ssl = TRUE),authenticate = TRUE,send = TRUE)