1

I am using the RDCOMClient library to automate outlook mails from R. Now the count of recipients' mail id changes periodically. Is there any way to automatically access the ** Email ID ** column in a data frame, say df, and send mail automatically?

Below is the existing code with static 2 recipients.

library(RDCOMClient)
OutApp <- COMCreate("Outlook.Application")
outMail = OutApp$CreateItem(0)
outMail[["To"]]=paste("abc@xyz.com","kksk@xyz.com", collapse=NULL)

MSM
  • 69
  • 7

1 Answers1

0

Sure it sounds easy enough. Consider the following Dataframe

df <- data.frame(emails = c("abc@xyz.com","kksk@xyz.com", 'yyz@tup.org'))
recipients <- df$emails
OutApp <- COMCreate("Outlook.Application")
outMail = OutApp$CreateItem(0)
outMail[["To"]]=paste(recipients)
recipients

Marshall K
  • 302
  • 1
  • 8
  • I receive error as checkErrorInfo> 80020009 No support for InterfaceSupportsErrorInfo checkErrorInfo -2147352567 Error: Exception occurred – MSM Jul 08 '21 at 18:08