I followed the following instructions 4018709 and it worked well. To summarize, you need the content identifiers for the attachment, which must be formatted as message identifiers (which, in turn, are formatted as email addresses using @ and the domain) and have the content identifier in the header of the MIME part of the image enclosed in angle brackets (for example, you already do).
So, an example email might look like this:
Date: Fri, 2 Dec 2011 06:57:55 GMT Message-Id: < 201112020657.pB26vttQ010231@geek.co.il > Content-Type: multipart/related; boundary="=-blabla"; type="multipart/alternative" From: Some sender < some-sender@geek.co.il > To: Me < me@geek.co.il > Subject: HTML content with embedded images MIME-Version: 1.0 --=-blabla Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable <html><body> <h1>Header</h1> <h2><a href=3D"http://geek.co.il">link</a></h2> <p> <img border=3D"0" = src=3D"cid: some.random.id@geek.co.il "/> <p> </body></html> --=-blabla Content-ID: < some.random.id@geek.co.il > Content-Disposition: inline; filename="image.png" Content-Type: image/png; name="image.png" Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAA9YAAAE2CAMAAACz7PorAAADAFBMVEUAAAC9...
source share