如何用mailR发送超链接?

时间:2016-04-02 07:53:21

标签: r email hyperlink

示例代码:

library(mailR)

path='/Users/me/Downloads/file.xlsx'

send.mail(from = sender,
          to = recipients,
          subject = 'email with hyperlink',
          body = c(path),
          html = FALSE,
          inline = FALSE,
          smtp = list(host.name = a, port = b, 
                      user.name = c,            
                      passwd = d, ssl = TRUE),
          authenticate = TRUE,
          send = TRUE)

是否可以将路径显示为电子邮件正文中的超链接?

1 个答案:

答案 0 :(得分:1)

使用您的示例:

library(mailR)

path="file:///C:\\Users\\me\\Downloads\\file.xlsx"

send.mail(from = sender,
          to = recipients,
          subject = 'email with hyperlink',
          body = path,
          html = FALSE,
          inline = FALSE,
          smtp = list(host.name = a, port = b, 
                      user.name = c,            
                      passwd = d, ssl = TRUE),
          authenticate = TRUE,
          send = TRUE)