【问题标题】:I can't attach html file while using emayili使用 emayili 时无法附加 html 文件
【发布时间】:2020-05-23 10:55:14
【问题描述】:

我正在尝试使用包 emayili 发送电子邮件,我需要附加一个 html 文件。代码运行良好,我收到了电子邮件,但文件从未附加。我一直在搜索和更改我的代码,但它总是死路一条。

这是我的代码:

     email <- envelope() %>%
      from("1234@gmail.com") %>%
      to("1234@gmail.com") %>%
      subject("subject") %>%
      body("text")
    files<-xml2::read_html(paste("D:/path/file",".html",sep=""))
    email <- email %>% attachment(files)
smtp <- server(host = "smtp.gmail.com",
               port = 465,
               username = "1234@gmail.com",
               password = "pass")
smtp(email, verbose = TRUE)

也试过

email <- email %>% attachment(read_html(paste("D:/path/file",".html",sep="")))

还有其他几件事......

有什么建议吗? 感谢您的宝贵时间

【问题讨论】:

    标签: html email rstudio attachment


    【解决方案1】:

    尝试发送到非 gmail 域的电子邮件,看看附件是否来了。我刚刚注意到附件来自不同的域,但我的 Gmail 帐户没有收到它。 (尝试从 R 发送 .nb.html 输出。)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-11
      • 1970-01-01
      • 2023-02-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多