I am trying to embed a JPEG image created by R into an e-mail, with the intent of creating an automated daily e-mail that displays a chart with dynamic text. I was able to attach the image, and designating the contend ID; however, when I send the message and open the result in Outlook, I get a question mark where the image should be. The image does indeed attach to the e-mail successfully, it looks like the image just isn't rendering inline in the HTML.
Here's my sample code:
library(mailR)
send.mail(from = "xx@xxx.com",
to = "xxx@xxx.com",
subject = paste("Results for the date ending ", Sys.Date()-1, sep = ""),
body = '<html> Test image - <img src="cid:test_img.jpg" /></html>',
html = TRUE,
smtp = list(host.name = "xxx.xxx.com", user.name = "xxx@xxx.com", passwd = "xxx"),
attach.files = '/Users/xxx/Documents/Rplots/test_img.jpg',
authenticate = TRUE,
inline = TRUE,
send = TRUE)
Any ideas on what's going on?