I'm trying to send an e-mail using package emayili and I need to attach an html file. The code runs well and I receive the e-mail, but the file never goes attached. I've been searching and changing my code, but it is always a dead end.
Here is my code:
email <- envelope() %>%
from("1234@gmail.com") %>%
to("1234@gmail.com") %>%
subject("subject") %>%
body("text")
files<-xml2::read_html(paste("D:/path/file",".html",sep=""))
email <- email %>% attachment(files)
smtp <- server(host = "smtp.gmail.com",
port = 465,
username = "1234@gmail.com",
password = "pass")
smtp(email, verbose = TRUE)
also tried
email <- email %>% attachment(read_html(paste("D:/path/file",".html",sep="")))
and several other things...
Any advice? Thank you for your time