Corrupted items in PST file

We are creating PST files using latest Aspose.Email library 17.2. Many items (email, contacts, calendar items) in PST are corrupted and cannot be opened/previewed in Outlook. Any idea how to resolve this issue? Thanks.




Source code used:





private static string AddMessage(DataContent dataContent, FolderInfo targetFolder)


{


using (var stream = new MemoryStream(dataContent.ToMsg().Content))


{


using (var message = MapiMessage.FromStream(stream))


{


var id = targetFolder.AddMessage(message);


return id;


}


}


}

Hi,


Thank you for posting your inquiry.

We have tried to reproduce such issue at our end by adding different message types to PST file but were not able to observe the problem at our end. We are using the latest version of Aspose.Email for .NET 17.3.0 at our end. Please try with this latest version and if the issue still persists, please share your sample MSG files with us that you are adding to PST. We’ll look into these for assisting you further.

Hi,

There was an issue with AddSubFolder call with 2 parameters:
parentFolder.AddSubFolder(folderInfo.FolderName, folderInfo.FolderClass);

If folderInfo.FolderClass was empty string some items in that folder inside PST file were corrupted.

It works OK now when we call this method without 2nd parameter: parentFolder.AddSubFolder(folderInfo.FolderName);

Hi,


Thank you for the feedback and please feel free to write us back if you have any other query related to Aspose.Email.