Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0
-
None
-
Operating System: other
Platform: Other
-
37344
Description
I was having a problem sending HTML Emails with inline image attachments against
the client Microsoft Outlook 2000 SP-3. I am using commons-email-1.0.jar.
This bug report proposes a solution include code.
Suppose with an HtmlEmail I am embedding 2 images, adding an HTML part and Text
part.
The resultant Body structure is:
Entity Content-Type Encoding
1 text/plain 7bit
2 multipart/related
2.1 text/html 7bit
2.2 image/jpeg base64
2.3 image/jpeg base64
Outlook, by default, shows the text part with the HTML email as an attachment
(correctly showing the images). My "problem" is that I think the HTML should be
shown by default.
I am guessing that it is an issue with this particular email client and the Body
Structure format ? (see here, for example: COM-1526)
—
I have fixed this for my own purposes and am recording the details here for the
benefit of others. I don't know whether this should be categorised as a bug in
commons-email-1.0.jar or a bug in Outlook. I suspect the latter, but since back
versions of Outlook will never get fixed, the pragmatic solution is to alter
commons-email, particularly in cases if you are targeting a known finite set of
email clients.
I am fully expecting a committer to categorize this as WONTFIX, but at least the
attachment I will add may allow others to use my code.
My code has been tested to work on:
Microsoft Outlook Express 6.00
Microsoft Outlook 2000 SP-3
Microsoft Outlook 2002
Microsoft Outlook 2003
Qualcomm Eudora 6.0.3.0
SquirrelMail 1.5.1 (webmail client)
Hotmail (as of November 2005)
Gmail (as of November 2005)
These clients are all happy to receive and display HTML emails in the expected
way using this Body Structure:
Entity Content-Type Encoding
1 multipart/alternative
1.1 text/plain 7bit
1.2 text/html 7bit
2 image/jpeg base64
3 image/jpeg base64
I have not tested with attachments that do not relate to the HTML and may not
support this scenario; however this is not normal usage scenario (well, for me
anyway).