I'm using the RDCOMClient
library to create an Outlook email. I want to send a ggplot
as an image inside the email body (inline), not as an attachment.
The only way I see this as possible is adding the plot as an image inside the HTMLBody
property. I tried 2 different methods to add the image in html.
1 - Using the RMarkdown
library, I created a html page with the plot. This did not work because the image is encoded as a base64
string, that Outlook does not support.
2 - Saving the ggplot to a file and manually creating a simple html such as: <html><body><img src="**path**/my_plot.png" /></body></html>
. This also shows an error instead of the image.
Is there a way to add an image inline?
EDIT:
The second method works on local email, but the receiver's message has an error instead of the actual image.