Created attachment 27222 [details] RTF message The attached file as been created as following (Microsoft Outlook 2007): - Go to Tools -> Options -> Mail Format -> Signatures - Create a new signature (e.g. Demo) - Add a picture to your new signature (e.g. My Documents/My Pictures/Sample Pictures/Blue hills.jpg) - Send an email using that signature - Use the received message to do the test I want to be able to extract the image data in the signature using MAPIMessage class, but the attachment has a null value in the attachData property. On the other hand, this message has the following header: Content-Type: application/ms-tnef; name="winmail.dat"
If the attachment data is empty, then that normally means there's a attachmentDirectory instead. Did you check that?
Nick, If the attachment data is empty, I can get the attachment as embedded message by using attachment.attachmentDirectory.getAsEmbededMessage() which helps to get the .msg attachment properties like ( from,CC,TO,BCC, etc). But I have the special use case, where I want to get the embeddedMessage as binary. If I save the binary as .msg, I should able to open that with Microsoftoutlook. Is there anyway I can get the embedded message as binary?. If this feature is not already there , Will you please add the functionality to extract the binary or InputStream for the given MAPIMessage?. Thanks Selva
The outlook format doesn't work that way, so there's no input stream to just fetch. Nested outlook files are stored expanded in the ole2 stream. (Other embedded files are typically stored as just the one entry, so they can be fetched directly) You could try copying the root directory of the attachment into a new POIFSFileSystem (there's a POIFS util to help with that), and see if that plays nicely with a copy of outlook. That should work just fine with HSMF, as that's largely analogous to what getAsEmbededMessage() does, I just don't know if there's any extra magic that a .msg file needs for outlook that is stored outside of the directory