We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Extraction from PST. Bad attachment when Attachment is Msg

Whenever we have attachments of type EmbeddedItem(like Msgs that came as attachment), we get a bad attachment for the Msg-Attachment.
We are using this method for saving the Msg file with EntryIds

using (FileStream fs = File.OpenWrite(physicalFilePath))
_personalStorage.SaveMessageToStream(entryId, fs);

We have seen related issues being worked

with resolutions here;

I guess these updates have fixed the issue with Aspose.Email.Mapi.MapiMessage.
But we still have this issue when using SaveMessageToStream from PersonalStorage object.

I can attach a sample PST with just one email just so that you can reproduce it.


Please share the sample PST you mentioned so that we can reproduce the issue at our end and assist you further.

Below is the link to the pst you can test with. I guess it is not about the PST, more about using the method _personalStorage.SaveMessageToStream(entryId, fs);




Thanks for sharing the PST file. We are working on your query and will get back to you soon.


We were able to reproduce the issue reported by you. A ticket has been logged in our issue tracking system as EMAILNET-39100 to investigate this further. We will get back to you as soon as we have additional information.
In the meantime, you can use the code snippet given below to convert PST to MSG.

PersonalStorage pst = PersonalStorage.FromFile(pstFilePath);
FolderInfo inbox = pst.RootFolder.GetSubFolder("Inbox");
MessageInfoCollection msgsColl = inbox.GetContents();
foreach (MessageInfo msgInfo in msgsColl)
    MapiMessage mapi = pst.ExtractMessage(msgInfo.EntryId);

We hope that this resolves the issue you were facing. Please feel free to contact us if additional information is required.

Thanks for the update. We are aware of this method.
Do let us know if you are able to fix the other method for _personalStorage.SaveMessageToStream(entryId, fs);


We have logged a ticket as EMAILNET-39100 against your specific scenario. We will update you here as soon as we have additional information.

The issues you have found earlier (filed as EMAILNET-39100) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan