Update: Both work now, thanks to a Microsoft365R package revision by package author and maintainer Hong Ooi.Īs of this writing, you'll need to install the development version of Microsoft365R from GitHub with remotes::install_github("Azure/Microsoft365R") also install emayili from CRAN. ! And at the time of this writing, while the Microsoft365R documentation said it is also compatible with the emayili R email package, I couldn't get it to work. In theory, you should also be able to include inline images when sending your email, but I had mixed success with that so can’t recommend it yet. There are a few more things you can do with email objects, such as add an attachment with the add_attachment() method.
#Outlook onedrive code
In the example code below, I save some Markdown to a variable called blastula_body_text. You can do this by first loading the blastula package and then saving some Markdown as an R character string. You can use Markdown instead of raw HTML in the email body if you pair Microsoft365R with the blastula package.
Sharon MachlisĮmail created by R and not yet sent appears in your Outlook Drafts folder. Creating an email object this way will also generate a message that appears in your Outlook Drafts folder.
Adding it as an argument to the authentication function sometimes helps with approval: my_outlook This is my email body with bold text.")$ set_subject("My 2nd email subject")$ set_recipients(to = above code creates an email object with content type HTML and uses HTML formatting in the message. That app ID in bold is Microsoft’s official app ID. Microsoft Azure GitHub repoĪdvice on dealing with Microsoft365R authentication issues. That vignette links to another page with some helpful advice. You can view the vignette by running the base R vignette function vignette("auth", package = "Microsoft365R").
#Outlook onedrive how to
You may run into a problem with your work account and see an error that authentication failed “due to policies configured by your administrator.” The Microsoft365R authentication vignette has some suggestions on how to deal with this.