r - mailR: how to send rmarkdown documents as body in email? -



r - mailR: how to send rmarkdown documents as body in email? -

how send rmarkdown generated documents body in email, using r?

i have tried knitr mailr, when instead generating html-report (new) rmarkdown-package fails.

library(mailr) send.mail( = "from@gmail.com", = "to@gmail.com", subject = "mymail", html = t, inline = t, body = "my_report.html", smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "username", passed = "password", ssl = t), authenticate = t, send = t )

error:

org.apache.commons.mail.emailexception: building mimemessage failed @ org.apache.commons.mail.imagehtmlemail.buildmimemessage(imagehtmlemail.java:110) @ org.apache.commons.mail.email.send(email.java:1436) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25) @ java.lang.reflect.method.invoke(method.java:597) @ rjavatools.invokemethod(rjavatools.java:386) caused by: java.io.ioexception: cant resolve next file resource :/users/username/myfolder/./data:image/png;base64,ivborw0kgg … (…) … suqmcc @ org.apache.commons.mail.resolver.datasourcefileresolver.resolve(datasourcefileresolver.java:105) @ org.apache.commons.mail.resolver.datasourcefileresolver.resolve(datasourcefileresolver.java:79) @ org.apache.commons.mail.imagehtmlemail.replacepattern(imagehtmlemail.java:149) @ org.apache.commons.mail.imagehtmlemail.buildmimemessage(imagehtmlemail.java:103) ... 6 more error: emailexception (java): building mimemessage failed

i guess has next line: cant resolve next file resource :/users/username/myfolder/./data:image/png;base64?

i'm more grateful kind of guidance.

mailr not back upwards resolving inline images encoded using info uri scheme (http://en.wikipedia.org/wiki/data_uri_scheme).

for time being, suggest next solution address problem. in future, getting mailr back upwards natively.

first off, create html file r terminal (the of import thing here options not include "base64_images" --- see ?markdown::markdownhtmloptions):

library(knitr) knit2html("my_report.rmd",options="")

now can send resulting html file via mailr:

send.mail(from = "from@gmail.com", = "to@gmail.com", subject = "mymail", html = t, inline = t, body = "my_report.html", smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "username", passwd = "password", ssl = t), authenticate = t, send = t)

r email rmarkdown sendmailr

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -