Bug 58078 - Trying to read HTML body of email message returns null
Summary: Trying to read HTML body of email message returns null
Alias: None
Product: POI
Classification: Unclassified
Component: HSMF (show other bugs)
Version: unspecified
Hardware: PC All
: P2 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2015-06-26 09:28 UTC by georgek901
Modified: 2015-06-30 11:05 UTC (History)
0 users

Example HTML Message created by Outlook 2013 (17.50 KB, application/x-ole-storage)
2015-06-26 09:28 UTC, georgek901

Note You need to log in before you can comment on or make changes to this bug.
Description georgek901 2015-06-26 09:28:08 UTC
Created attachment 32859 [details]
Example HTML Message created by Outlook 2013

Hello together,

i tried to read out my html content from my self created mail with outlook 2013. My test application returns null when i call the MAPIMessage.getHTMLBody() method. If you want to try to read out, you'll get the mail as attachment down below.

Kind regards

Comment 1 Nick Burch 2015-06-26 14:49:34 UTC
Outlook often decides to put the rich text content into the RTF rather than HTML fields, for reasons known only to itself. Can you try fetching the RTF body and see if you get your formatted message back?
Comment 2 georgek901 2015-06-30 05:56:13 UTC
Yes i can retrieve it with getRTFBody method, but i need the html formatted message. Is there any way to get it as html formatted message?
Comment 3 Nick Burch 2015-06-30 11:05:13 UTC
You'll need to use an RTF to HTML conversion tool then. Apache Tika is able to do that for you, amongst several options

As Apache POI is correctly returning what's in your file, I'm closing the bug