I am trying to send an html email (with alternate text) that includes an inline / inline image using JavaMail.
I wanted to see how a properly formatted message looked, so I sent it using gmail with an embedded image, and below is the source. They seem to insert body parts into the message. How can I reproduce this EXACTLY using javamail. I have not found a way to place Multipart inside another Multipart.
MIME-Version: 1.0 Received: from 10.50.75.3 with HTTP; Thu, 23 Feb 2012 20:15:34 -0800 (PST) Date: Thu, 23 Feb 2012 20:15:34 -0800 Delivered: x@gmail.com Message ID: Subject: c From: Foo Bar To: Foo Bar Content -Type: multipart / related; border = e89a8f3b9b051e124104b9ae03fb
- e89a8f3b9b051e124104b9ae03fb Content-Type: multipart / alternative; border = e89a8f3b9b051e123604b9ae03fa
- e89a8f3b9b051e123604b9ae03fa Content-Type: text / plain; encoding = ISO-8859-1
text content goes here
- e89a8f3b9b051e123604b9ae03fa Content-Type: text / html; encoding = ISO-8859-1
- e89a8f3b9b051e123604b9ae03fa-- --e89a8f3b9b051e124104b9ae03fb Content-Type: image / png; name = "logo.png" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: ii_135ad92205fc1ace
iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM / rhtAAAAh0lEQVR42u3ZsQnAIBBGYVtHShVI 7ViprASXcw8HMCckEGyTkB98xWsE4WvOwnMhBG / tVrGaSOU0 + Q5MVhMtdWAVBlY3HCyW + 7nlbhqB TiGAAAECBAhwMqB0AN8ANuUkgQzJvEPy1WP75C5AgAABAgQ4GXATAK4DUP8LOAsD87WGiIJriGj5 AwiiiyDxmymtAAAAAElFTkSuQmCC --e89a8f3b9b051e124104b9ae03fb -
UPDATE:
Using standard methods of multiple inline images (for example, those related to lechlukasz), you will receive the following letter, not quite what I need:
MIME-Version: 1.0 Received: 10.236.146.106 with SMTP identifier q70mr1894063yhj.0.1330071158663; Fri, 24 Feb 2012 00:12:38 -0800 (PST) Reply to: Foo Bar Message-ID: < 20cf303bfc80f02cfa04b9b152db@google.com > Date: Fri, February 24, 2012 08:12:38 +0000 Subject: please, oh please4 From: Foo Bar To: Foo Bar Content-Type: multipart / alternative; border = 20cf303bfc80f02ce704b9b152d6
- 20cf303bfc80f02ce704b9b152d6 Content-Type: text / plain; encoding = UTF-8; Format = tech; delsp = yes Copy content transfer: base64
77 + 9UE5HDQoaDQoAAAANCklIRFIAAAAoAAAAKAgGAAAA77 + 977 + 977 + 9bQAAAO + / vUlEQVR477 + 9 77 + 977 + 977 + 9Ce + / vSAgDQoQRmFbR0oVSO + / vVjvv73vv70E77 + 9cw8HMCckEGzvv73vv70ffO + / vWsE77 + ++ 9a / ve + / vXMhBG / vv71W77 + 977 + 9SO + / vTTvv70OTFYTLXVgFQZWNxws77 + 977 + 977 + 9 77 + 9bhrvv71OIe + / vQABAgQIcDLvv710AO + / vQA277 + 9JO + / vQzvv73vv71D77 + 977 + 9Y ++ / ve + / vS5A77 + 9AAECBDg70 + 9AADV77 + 9AADV77 + 9A1D7777 + 9A1D7777 + 9AADV77 + 9A77D7770 + 9A1D7777 + 9A1D7770 + 9AADV77 + 9A77D7770 + 9AADV77 + 9A77D7770 + 9A1D7777 + 9A1D7770 + 9A1D7770 + 9A1D7770 + 9A1D7777 + 9A1V77 + 9A / ve + / vSDvv73vv70p77 + 9AAAAAElFTkTvv71CYO + / vQ0K --20cf303bfc80f02ce704b9b152d6 Content-Type: text / html; charset = ISO-8859-1 Content-Transfer-Encoding: quoted-printable
- 20cf303bfc80f02ce704b9b152d6 -