r - How to embed a html file in email body using RDCOMClient -
i creating html output of dataframe url in 1 of column hyperlinked. want embed in email body instead of attachment, using rdcomclient package.
forget rdcomclient. try e.g. send data frame df
gmail account:
library(mailr) library(xtable) df <- data.frame(links = sprintf('go <a href="%s">here</a>', c("http://stackoverflow.com/questions/31290427/how-to-embed-a-html-file-in-email-body-using-rdcomclient", "http://stackoverflow.com/")), x = 1:2) html <- print(xtable(df), type = "html", include.rownames = false, sanitize.text.function = force) send.mail(from = "...@gmail.com", = "...@gmail.com", subject="subject", body = html, html = true, smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "username", passwd = "password", ssl = true), authenticate = true, send = true)
(you may need allow access less secure apps.)
Comments
Post a Comment