I am creating an html output of the dataframe so that the url in one of the column is hyperlinked. Want to embed this in email body instead of attachment, I am using RDCOMclient package.
Asked
Active
Viewed 1,356 times
1 Answers
0
Forget about RDCOMclient. Try this to e.g. send the data frame df
to a 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",
to = "...@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 to allow access to less secure apps.)

lukeA
- 53,097
- 5
- 97
- 100