Home > Enterprise >  Sending email without Java in R
Sending email without Java in R

Time:05-20

How to send HTML format email in R, without the need for Java?

The package mailR is no longer usable as it is dependent on Java. What are the alternate packages?

Note: The following worked well with mailR and trying to replicate the same.

send.mail(from = fromEmailAddress,
          to = mailTo,
          subject = subjectDetailed ,
          body = bodyToSend,
          html = TRUE,
          smtp = list(host.name = hostname, port = 25), 
          send = TRUE 
)

CodePudding user response:

blastula, Microsoft365R are couple of great packages for HTML emails and also support Rmarkdown report emails

[blastula] https://github.com/rstudio/blastula

[Microsoft365R] https://github.com/Azure/Microsoft365R

CodePudding user response:

The following works.

library(sendmailR)

msg = mime_part(bodyToSend)
msg[["headers"]][["Content-Type"]] = "text/html"

sendmail(mailFrom,mailTo,subject, msg, control=list(smtpServer= "smtpserver"))
  • Related