When i am using latest version R RDCOMClient package for sending outlook Emails, It is showing up an error : "[[<- defined for objects of type "S4" only for subclasses of environment"
Code for the same:
library(RDCOMClient)
## init com api
OutApp <- COMCreate("Outlook.Application")
## create an email
outMail = OutApp$CreateItem(0)
outMail$GetInspector()
signature = outMail[["HTMLBody"]]
## configure email parameter
outMail[["To"]] = "some@outlook.com"
outMail[["CC"]] <- "Some@outlook.com"
outMail[["subject"]] = "some subject"
outMail[["body"]] = "some body"
outMail[["Attachments"]]$Add("C:\\Users\\Some\\Desktop\\file.csv")
outMail[["HTMLBody"]] = paste0('<p>some body', signature, '</p>')
## send it
outMail$Send()
**Error:**
signature = outMail[["HTMLBody"]]
Error in mget(plabels[hasSubclass], env) : invalid first argument
## configure email parameter
outMail[["To"]] = "some@outlook.com"
Error in `[[<-`(`*tmp*`, "To", value = "some@outlook.com") :
[[<- defined for objects of type "S4" only for subclasses of environment