使用sendmailR代码
library(sendmailR)
sendmail(from, to, subject, body,
control = list(smtpServer='ASPMX.L.GOOGLE.COM'))
并使用mailR就像
一样library(mailR)
send.mail(from, to, subject, body,
smtp = list(host.name = "smtp.gmail.com", port = 465,
user.name="something@gmail.com", passwd="something", ssl=TRUE),
authenticate = TRUE,
send = TRUE)
我想知道为什么第一个代码中不需要密码? 是' 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, port = port, blocking = TRUE) :
ASPMX.L.GOOGLE.COM:25 cannot be opened
我在胜利7中。