0

I have been successfully sending mails through rstudio using RDCOM till today. my rstudio version is 3.5.1 and i used this link to install RDCOM

my code is as follow

install.packages("RDCOMClient", repos = "http://www.omegahat.net/R")
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()
<checkErrorInfo> 80020009 
No support for InterfaceSupportsErrorInfo
checkErrorInfo -2147352567
Error: Exception occurred.

have spent a few hours trying to fix it but i am unable to fix it so far. It fails at the add attachment part

1 Answers1

0

Just a work around:

Created a list using outlook and then used that to send the email out. Code worked fine with one email address, it has issues working with multiple email addresses.

  • If you want to send to multiple people in the To line you need to separate by a semicolon ; as opposed to a comma. I got the same error when trying to use a comma in between multiple emails. – Melissa Salazar Dec 01 '20 at 17:37