I have an html file as an result of my Rmarkdown code. Now I need to send an email with this html file directly in the body of the email, and not in the attachement. I was trying the solution from this post: "send HTML email using R" post But it seems that it works only with html text and not html file. Here what I've tried to do:
library(sendmailR)
from<-"<sender@enterprise.lan>"
to<-c("<reciever@enterprise.com>")
message ="./TEST.html"
subject = "Test HTML"
msg <- mime_part(message)
msg[["headers"]][["Content-Type"]] <- "file/html"
sendmail(from, to, subject, msg = msg,control=list(smtpServer="localhost"),headers=list("Content-Type"="file/html; charset=UTF-8; format=flowed"))
This trial send me an email but with "TEST.html" file attached, and not in the body directly. Obviously I'm doing something wrong, I'm struggling with this task for days, can someone help me, please?