# Windows COM Client and sending emails through Outlook

**URL:** <https://discourse.julialang.org/t/windows-com-client-and-sending-emails-through-outlook/10887>\
**Category:** General Usage\
**Tags:** windows\
**Created:** [May 14, 2018, 6:32pm UTC](https://discourse.julialang.org/t/windows-com-client-and-sending-emails-through-outlook/10887 "2018-05-14T18:32:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacobcvt12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jacobcvt12/32/2695_2.png) [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Post date:** [May 14, 2018, 6:32pm UTC](https://discourse.julialang.org/t/windows-com-client-and-sending-emails-through-outlook/10887/1 "2018-05-14T18:32:01Z")

</div>

I currently have some R code that uses the package [RDCOMClient](https://github.com/omegahat/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

```julia
library(RDCOMClient)
outApp <- COMCreate("Outlook.Application")
outMail <- outApp$CreateItem(0)
outMail[["To"]] <- as.character("recipient@mail.com")
outMail[["SentOnBehalfOfName"]] <- "sender@mail.com"
outMail[["subject"]] <- "subject of email"
outMail[["body"]] <- "body of email"
outMail$Save() # to save as draft

```

---

<div class="post-metadata">

**Author:** ![tshort](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tshort/32/43_2.png) [@tshort](https://discourse.julialang.org/u/tshort)\
**Post date:** [May 14, 2018, 6:46pm UTC](https://discourse.julialang.org/t/windows-com-client-and-sending-emails-through-outlook/10887/2 "2018-05-14T18:46:42Z")

</div>

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

> **[7 Send Email Command Lines & How to Use: Step-by-Step](https://whatsoftware.com/sending-email-using-command-line-useful-for-downtime-alert-notification/)**
>
> Not only is email very useful for communication between friends and families and sending messages with attachments such as reports, photos, documents,

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).

---

<div class="post-metadata">

**Author:** ![jacobcvt12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jacobcvt12/32/2695_2.png) [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Post date:** [May 15, 2018, 2:04pm UTC](https://discourse.julialang.org/t/windows-com-client-and-sending-emails-through-outlook/10887/3 "2018-05-15T14:04:52Z")

</div>

Thanks @tshort!
