5

I am Working on googleVis Chart and wanted to Embed gvis object (image stored as HTML) as inline using mailR package.

I have the below code to send mail from my sever -

library(mailR)
send.mail(from = "admin_xxx@apsmail.xx.xxx.xx",
          to = c("first.second@jba.com"),
          subject = paste("Batch Job Stats on",now),
          body = paste("Dear Sir/Madam,<br><br>

                       Please find below the image",".<br><br>",
                       "<img src=\"D:/xx/Batch_Processing/Batch_Processing_Run/Rplot1.png\">",".<br><br>"
          ),
          html = TRUE,inline = TRUE,         
          smtp = list(host.name = "xxxx01.xxx.xxx.xx"),
          authenticate = FALSE,
          send = TRUE)

The above code is perfectly working fine - and I am embedding an image (present in the D drive of my server)

Now I am using googleVis to create a chart and storing them in html file. (present in the D drive of my server)

Gauge <-  gvisGauge(CityPopularity,
options=list(min=0, max=800, greenFrom=500,
greenTo=800, yellowFrom=300, yellowTo=500,
redFrom=0, redTo=300, width=400, height=300))
plot(Gauge)

print(Gauge, tag="chart", file="test1.html")

So now my question is that I am not able to embed my .html file (created using above code - test1.html) to send email with the googleVis chart image embedded in the mail description body.(I am not able to save the gvis object -Chart as .png). I have seen solution - similar to this in SO, but it's not helping me.

Yahs Hef
  • 797
  • 9
  • 24

1 Answers1

-1

on the off chance that you open the "tmp.html" as a record (i.e, location says documents://*/tmp.html), then security cautioning may happen. What you need is to get to the html through http://.

So on the off chance that you can alter any website page where tag is accessible (e.g., blogger), you can utilize it by basically duplicate and glue the substance of tmp.html, similar to this:

http://takahashik.blogspot.com/2011/01/googlevis-example.html

here is the celebrated "iris" form of case:

http://takahashik.blogspot.com/2011/01/googlevis-case for-information iris_10.html

Something else, in the event that you have a web server, you can utilize it by transferring the tmp.html on the server.

omikes
  • 8,064
  • 8
  • 37
  • 50