Search code examples
javaoutlookmsg

What's the best library for reading Outlook .msg files in Java?


I would like to read the text and binary attachments in a saved Outlook message (.msg file) from a Java application, without resorting to native code (JNI, Java Native Interface).

Apache POI-HSMF seems to be in the right direction, but it's in very early stages of development...


Solution

    • You could use Apache POIFS, which seems to be a little more mature, but that would appear to duplicate the efforts of POI-HSMF.

    • You could use POI-HSMF and contribute changes to get the features you need working. That's often how FOSS projects like that expand.

    • You could use com4j, j-Interop, or some other COM-level interop feature and interact directly with the COM interfaces that provide access to the structured document. That would be much easier than trying to hit it directly through JNI.