I am building a application that fetches messages and displays emails from gmail using the php version of the gmail-api.
I am having an issue displaying emails that contain inline images. I get "cid:google_logo net::ERR_UNKNOWN_URL_SCHEME" when I check the console. I have learnt that the cid:google_logo is referencing the image that is retrieved as an attachment. But how do I connect the image tag and and the separate attachment.
I am able to download the image from the attachment using php. Therefore I believe that I can change the image source in the html to reference the image i download on the server. But I am wondering if there is an easier way to directly link the html and the attachment from the gmail api.
I have looked at similar question: Cannot display inline images in HTML using Gmail API with RoR? and the resource provided in that question: Strategies for serving Base64 encoded images in HTML
However even as I tried replacing the following sample with my own encoded attachment data with my own. I am not able to produce a functioning image.
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />