Any idea how I would add an attachment to this email?
I tried to look at names(OutApp) to see if there was an "attachment" that I could assign to but there doesn't seem to be. Any ideas?
library(RDCOMClient)
SendEmail<-function(to, subject, body)
{
## init com api
OutApp <- COMCreate("Outlook.Application")
## create an email
outMail = OutApp$CreateItem(0)
## configure email parameter
outMail[["To"]] = "me@me.com"
outMail[["subject"]] = subject
outMail[["body"]] = body
## send it
outMail$Send()
}