Skip to content

Instantly share code, notes, and snippets.

@dickoa
Created February 1, 2022 14:17
Show Gist options
  • Save dickoa/8d74868598cefe70805b272b3bb721d2 to your computer and use it in GitHub Desktop.
Save dickoa/8d74868598cefe70805b272b3bb721d2 to your computer and use it in GitHub Desktop.
Sending email from R using Microsoft365R
library(Microsoft365R)
library(blastula)
outl <- get_business_outlook(app = "d44a05d5-c6a5-4bbb-82d2-443123722380") ## just once after you can do `outl <- get_business_outlook()`
body <- "## Hello!
This is an email message that was generated by the blastula package.
We can use **Markdown** formatting with the `md()` function.
Finally got this awesome package to work with `Microsoft365R`
```{r}
library(Microsoft365R)
outl <- get_business_outlook()
outl
```
This is awesome right?
Ahmadou"
email_body <- compose_email(
body = md(body),
footer = md("sent using Microsoft365R"))
email_body
email <- outl$create_email(email_body,
subject = "Blastula works!",
to = c("[email protected]", "[email protected]"))
email$send()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment