Skip to content Skip to sidebar Skip to footer

Send An Email With Dataframe As A Flextable

I have a code which I use to send mails everyday and I use the xtable package to get it done. But lately, I've got accustomed to using the flex table as it is more feasible to my r

Solution 1:

This is because print method is displaying the flextable, it does not return the HTML value. The method format(fletable_obj, type = "HTML") return the HTML value.

You should modify the HTML creation as:

msgJP <- try(mime_part(paste('<!DOCTYPE htmlPUBLIC"-//W3C//DTD XHTML 1.0
Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html; charset=utf-8" /><metaname="viewport"content="width=device-width, initial-scale=1.0"/><title>HTML demo</title><styletype="text/css"></style></head><body>',"hello,<br>","check out the data for self audit.","<br>",
format(flextable(samplemondata), type = "html"),
'</body></html>')))

Post a Comment for "Send An Email With Dataframe As A Flextable"