[R]:RDCOMClient and outlook : how to send to multiple recipients or cc someone?

Viewed 3183

as title, I have tried and failed... This is a piece of code I found in another thread and it works for only one recipient. Thanks in Advance.

OutApp <- COMCreate("Outlook.Application")
outMail = OutApp$CreateItem(0)
outMail[["To"]] = "xxx@xxx"
outMail[["subject"]] = "xx"
outMail[["body"]] = ""
outMail$Send()
2 Answers

use this highlighted code to share the emails to multiple lists

outMail[["To"]] = paste("xxxx@xxx.com","another@xxx.com", sep=";", collapse=NULL)

same logic with Cc for multiple list except below thing

outMail[["Cc"]]= "xxx@xxx.com"
Related