Windows COM Client and sending emails through Outlook



I currently have some R code that uses the package RDCOMClient, to send many generated emails through Microsoft Outlook. Is there any way to do this in Julia? I am not a Windows guy, so I don’t know if there might be some way to do this at a lower level? The relevant part of the R code that I am having difficulty translating is

outApp <- COMCreate("Outlook.Application")
outMail <- outApp$CreateItem(0)
outMail[["To"]] <- as.character("")
outMail[["SentOnBehalfOfName"]] <- ""
outMail[["subject"]] <- "subject of email"
outMail[["body"]] <- "body of email"
outMail$Save() # to save as draft


It might be easiest to use run() with an external utility. Here are some options:

I haven’t tried it, but one is a PowerShell option (you shouldn’t need to download anything, assuming your target audience will have this installed).


Thanks @tshort!