【问题标题】:Sending Email through RDCOM client in rstudio 3.5.1 Error: Exception occurred在 rstudio 3.5.1 中通过 RDCOM 客户端发送电子邮件错误:发生异常
【发布时间】:2020-02-11 10:36:16
【问题描述】:

直到今天,我一直使用 RDCOM 通过 rstudio 成功发送邮件。我的 rstudio 版本是 3.5.1,我使用此链接安装 RDCOM

install.packages("RDCOMClient", repos = "http://www.omegahat.net/R")

my code is as follow

OutApp <- COMCreate("Outlook.Application")
outMail = OutApp$CreateItem(0)
outMail[["To"]] = "username@outlook.com"
outMail[["subject"]] = "Test Subject"
outMail[["body"]] = "Body of email"  
outMail[["Attachments"]]$Add("C:\\Users\\destination\\file.csv")
outMail$Send()

今天我收到以下错误

80020009 不支持 InterfaceSupportsErrorInfo checkErrorInfo -2147352567 错误:发生异常。

已经花了几个小时试图修复它,但到目前为止我无法修复它。在添加附件部分失败

【问题讨论】:

    标签: rstudio rdcomclient


    【解决方案1】:

    我认为,我的问题是我在电子邮件的“收件人”部分中放置了多个电子邮件地址。

    它似乎正确地向一个人发送电子邮件

    【讨论】:

    • 如果要发送给 To 行中的多个人,您需要用分号分隔;而不是逗号。尝试在多封电子邮件之间使用逗号时遇到同样的错误。
    猜你喜欢
    • 2022-01-13
    • 1970-01-01
    • 2013-09-30
    • 2013-04-03
    • 1970-01-01
    • 1970-01-01
    • 2021-05-23
    • 2012-07-07
    相关资源
    最近更新 更多