Ho do I extract a Outlook message nested into another using Apache POI - HSMF?
- by Jan
I am using Apache POI - HSMF to extract attachments from Outlooks msg-files. It works fine except for nested messages. If an msg is attached to another msg I am able to get the files. If a message is nested I get the information but I need the file.
MAPIMessage msg = new MAPIMessage(fileName)
for(AttachmentChunks attachment : msg.getAttachmentFiles()) {
if(attachment.attachmentDirectory!=null){
MAPIMessage nestedMsg attachment.attachmentDirectory.getAsEmbededMessage();
// now save nestedMsg as a msg-file
}
}
Is it possible to save the nested message file as a regular msg-file?