Example Of Using Inline Images In Received / Incoming emails



I’m trying to figure out a way of displaying incoming emails with the images inlined as they were sent. Right now, we’re able to parse the incoming emails and all inline images are treated as attachments which gives us the image data. But, what we would like to do is:

  1. Identify inline images (some images are really attachments vs some were inlined)
  2. Render the inline images inlined in the text displayed to the user when we display the email we’ve received (this way the email is shown to the user the way the sender intended them to be viewed).,

Basically, we’re reading the incoming emails, storing them in a WordPress system and then displaying the messages on the screen.

If someone has done this before we’d be grateful for pointers, help or sample code. Not quite sure what we need to do to identify the area in the incoming message where the inlined images need to be inserted and then being able to insert them there (probably via an img tag).

Thanks in advance for any help