Following the directions provided in this related question, I was able to send html formated mail messages. Now the question is this: How should I modify the following code, in order to attach one or more files (of any type) to this message?
library(sendmailR)
from <- "<[email protected]>"
to <- c("<[email protected]>","<[email protected]>")
subject <- iconv("Message Title", to = "utf8")
msg <- "<hr size='2' width='33%' style='text-align: left;'><font size='2'>
<i>This email was sent automatically using <a href='http://finzi.psych.upenn.edu/R/library/sendmailR/html/00Index.html' rel='nofollow' target='_blank'>sendmailR</a>.<br>
Please do not reply directly to this e-mail.</i></font>"
msg <- iconv(msg, to = "utf8")
sapply(to,function(x) sendmail(from, x, subject, msg, control=list(smtpServer="###.###.###.###"), headers=list("Content-Type"="text/html; charset=UTF-8; format=flowed")))