如题,本人参考以下网站,尝试使用R语言发送邮件
- http://blog.csdn.net/small_farmer/article/details/52713795
[color=rgb(51, 102, 153) !important]复制代码
代码如下:
- library(mailR)
- #body正文
- body = "this is a test"
- #收件人
- recipients <- c("***@163.com", "***@qq.com")
- #发件人
- sender = "***@163.com"
- #主题
- title = "this is a title"
- #填上邮箱密码code,如body是html,设置body=html参数,那么发出来的正文就是html格式的了
- sendmail(
- from = sender,
- to = recipients,
- subject = title,
- body = html,
- encoding = "utf-8",
- html = TRUE,
- smtp = list(
- host.name = "smtp.163.com",
- port = 465,
- user.name = ***,
- passwd = "***",
- ssl = TRUE
- ),
- authenticate = TRUE,
- send = TRUE
- )
[color=rgb(51, 102, 153) !important]复制代码
出现了如下错误:
- 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) :
- localhost:25 cannot be opened
[color=rgb(51, 102, 153) !important]复制代码
亲爱的坛友们,这是怎么回事?怎么解决
请赐教
谢谢
|