I'm trying to create a MIME email from scratch with text and html alternatives and an inline image in the html. I get the email, and I see the html alternative in my mail client, but the inline image I expect to see is coming in as an attachment called ATT00001
Here's what it looks like prior to base64 encoding:
From: Me <me@example.com>
To: Me <me@example.com>
Subject: test message
MIME-Version: 1.0
Content-Type: multipart/related; boundary="_BOUNDRY_RELATED_"; type="multipart/alternative"
--_BOUNDRY_RELATED_
Content-Type: multipart/alternative; boundary="_BOUNDRY_ALT_"
--_BOUNDRY_ALT_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
This is text
--_BOUNDRY_ALT_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<body>
<h3>This is HTML</h3>
<img src="cid:myimage@example.com"/>
</body>
</html>
--_BOUNDRY_ALT_--
--_BOUNDRY_RELATED_
Content-Type: image/jpeg; name="myimage.jpg"
Content-Description: myimage.jpg
Content-Disposition: inline; filename="myimage.jpg"
Content-ID: <myimage@example.com>
Content-Transfer-Encoding: base64
/9j/4AAQSkZJRgABAQEAYABgAAD/7QEwUGhvdG9zaG9 ...
--_BOUNDRY_RELATED_--