How to show gmail inserted images in my webpage


I am using mailgun. now i am sending mail from gmail to my domain. using mailgun api i am getting that and showing that content in my webpage. but when i am adding images in middle of the text or in signature of the mail image is not showing in webpage. it is just showing broken image because it is showing like this:

<img width="375" height="134" src="cid:ii_i2davb0f0_1499f1c3646e87a5">

How can i show these images in web page?


I don't know how you create the body of your email, but it has to contain as a src a link to your server stored image like this:

(replace with this line in the file that creates the body of your email)

The part after the cid: is the unique identifier for the attachment that has that image. You will need to check the attachment headers, and match the one for that image, and likely de-base64/uudencode the image back to binary, store on your server, and show it using normal means.

Looking at their docs here,

There will be an attachment-x part of the returned message array, that there is one for each attachment. You will just have to check which one matches your identifier

My bad: they will be in the content-id-map section. Check the "Parsed Messages Parameters" section of the routes link above

By : Uberfuzzy

This video can help you solving your question :)
By: admin