I'm trying to send an Outlook mail thru R by using RDCOMClient and trying to attach an Excel file in it but getting an error.
Below is my script:
library(RDCOMClient)
## init com API
OutApp <- COMCreate("Outlook.Application")
## Create an email
outMail = OutApp$CreateItem(0)
## Configure email parameter
outMail[["To"]] = "ashishpatil@orientindia.net"
outMail[["cc"]] = "atulkadam@orientindia.net"
outMail[["subject"]] = paste0("RE: Update your Todays date",format(Sys.Date(),"%d-%m-%y"),"Timesheet.")
outMail[["body"]] = "Dear Sir/Madam,
Please find below the CMS Application - Total Count of Records Uploaded Status:"
outMail[["Attachments"]]$Add("C:/Users/atulkadam/OneDrive - Orient Technologies Pvt. Ltd/Atul/Time Sheet/atul kadam",Sys.Date(),".xlsx")
## Send it
outMail$Send()
when I run the Attachments code It shows me the below error.
Error in.COM(x, name, ...) :
[Error code][1] Can't attach the RDCOMServer package needed to create a generic COM object