我一直在使用R中的gmailR从R发送电子邮件没有问题,但是因为一周它一直在发生故障。有时候它有效,但大部分时间都没有。这就是来自github的Trinker包(而不是CRAN gmailr!):https://github.com/trinker/gmailR
这是我的剧本:
library(gmailR)
chartime <- as.character(Sys.time())
email_test <- function(chartime){
gmail("sjorsvanheuveln@gmail.com", password="************", subject = "Test No New Projects",
message = paste("Testing time at",chartime), from = "sjorsvanheuveln@gmail.com",
attachment = NULL, server = "smtp.gmail.com:587", username = "sjorsvanheuveln@gmail.com",
confirmBeforeSend = FALSE, clear.username = FALSE)}
email_test(chartime)
这是错误:
Error in jython.exec(rJython, mail) :
Only AF_INET sockets are currently supported on jython
7 stop(python.exception)
6 jython.exec(rJython, mail)
5 email.helper(to = list(to[i]), from = list(from), subject = subject,
message = message, attachment = atts[[i]], username = username,
password = password, server = server, confirmBeforeSend = confirmBeforeSend)
4 FUN(1L[[1L]], ...)
3 lapply(seq_along(to), function(i) {
email.helper(to = list(to[i]), from = list(from), subject = subject,
message = message, attachment = atts[[i]], username = username,
password = password, server = server, confirmBeforeSend = confirmBeforeSend) ...
2 gmail("sjorsvanheuveln@gmail.com", password = "**********", subject = "Test No New Projects",
message = paste("Testing time at", chartime), from = "sjorsvanheuveln@gmail.com",
attachment = NULL, server = "smtp.gmail.com:587", username = "sjorsvanheuveln@gmail.com",
confirmBeforeSend = FALSE, clear.username = FALSE)
1 email_test(chartime)
这是我的会话信息:
R version 3.1.3 (2015-03-09)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.5 (Yosemite)
locale:
[1] nl_NL.UTF-8/nl_NL.UTF-8/nl_NL.UTF-8/C/nl_NL.UTF-8/nl_NL.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] gmailR_1.0 rJython_0.0-4 rjson_0.2.15 rJava_0.9-7
loaded via a namespace (and not attached):
[1] tools_3.1.3 XML_3.98-1.3
我该如何解决这个问题?
答案 0 :(得分:2)
不支持AF_INET6已修复Jython 2.5.2,请参阅http://bugs.jython.org/issue1210(事实上,您的问题出现在不同的路由器上,这表明它是IPv4与IPv6。)但是,rJython捆绑了旧版本的Jython jar。也许这可以升级,即使不是2.7?
与rJython软件包的维护者联系可能是值得的。