Hi R experts,
I tried to send a data table by "sendmail" in sendmailR package.
Here is my code:
library(xtable)
library(sendmailR)
employee <- c('John Doe','Peter Gynn','Jolie Hope')
salary <- c(21000, 23400, 26800)
outputf <- data.frame(employee, salary)
from <- "xxx1@xxx.com"
to <- "xxx2@xxx.com.tw"
subject <- "update"
body <-print(xtable(outputf,caption = 'a data table'),type='html',caption.placement = 'top')
mailControl=list(smtpServer="123",port=1)
sendmail(from=from,to=to,subject=subject,msg=body,control=mailControl)
However, the output in the email is a mess (see below)
tr>
Could you please suggest a way to write a data frame in an email?
Thanks.
Best,
Veda