在AWS中从R发送电子邮件

时间:2017-11-15 10:13:57

标签: r amazon-web-services sendmail sendmailr

我正在尝试从AWS虚拟机发送测试电子邮件(使用EC2实例。)

我的R代码运行良好,但我现在正尝试使用sendmailR将测试电子邮件发送到我的电子邮件地址。

我收到以下错误消息:

socketConnection错误(host = server,port = port,blocking = TRUE):   无法打开连接 另外:警告信息: 在socketConnection中(host = server,port = port,blocking = TRUE):   localhost:25无法打开

 install.packages("sendmailR")
 library(sendmailR)

 sendmail(from = "XXXX@gmail.com",
      to = "YYYY@gmail.com",
      subject = "Subject of the email",
      body = "Body of the email",
      smtp = list(host.name = "smtp.gmail.com", port = 80 , user.name = "XXXX@gmail.com", passwd = "XXXX", ssl = TRUE),
      authenticate = TRUE,
      send = TRUE)

有谁知道这是如何克服的?

0 个答案:

没有答案