#
console
R

mailR

I love the type functionalities that allow using R for more than stats – send emails from R, because Outlook sucks, Thunderbird often crashes and Mail … never mind Mail.

Compose your email using Rmarkdown and knitr ; Rstudio > File >New File > Rmardown > HTML

Write your email in Rmarkdown, check the documentation on Rmardown it’s very straightforward, then knit it. You can then use mailR to send the email as HTML – inline=TRUE indicates whether images in the HTML file should be embedded inline.

devtools::install_github("rpremraj/mailR")

library(mailR)

send.mail(from = "my_email@gmail.com", to = "your_email@hotmail.com", subject = "test2", html = TRUE,
inline = FALSE, body = "Example.html", smtp = list(host.name = "smtp.gmail.com", port = 993, user.name = "username",
passwd = "password", ssl = T), authenticate = T, send = T)
Advertisements

Discussion

No comments yet.

reply()

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: