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 = "email@example.com", to = "firstname.lastname@example.org", 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)