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

Free Support Forum - aspose.com

FolderInfo.GetContents not showing all the messages


FolderInfo.GetContents() method not retrieving all the messages. It is only retrieving 50 messages. FolderInfo.ContentCount is showing 301 as count. Please help me to solve this issue.
Here is my code
using (PersonalStorage pst = PersonalStorage.FromFile(pstFilePath))
// Get the folders information
FolderInfo folderInfo = pst.GetFolderById(folderKey);
MessageInfoCollection messageInfoCollection = folderInfo.GetContents();
if (messageInfoCollection.Count > 0)
foreach (MessageInfo message in messageInfoCollection)
//do stuffs here

Hi Sudhir,

Thank you for writing to Aspose Support team.

You are facing this problem due to the evaluation limitations of the API which are imposed if you are not initializing license in your application. If you don’t have a license, please try getting a temporary license from here which will allow you to evaluate the API functionality without any limitations for 30 days. Please feel free to write to us if you have any further query in this regard.

Thank you. I will try this & will let you know.

Thank you!!!

It is working.


You are welcome.

Hi I have the same issue, how can i resolve it… I am a developing the code for trail purpose. How can I solve this issue to get retrive emails in 1000’s.


It’s a old thread that you have referred to. Can you please try using latest Aspose.Email for .NET 20.9 on your end and in case there is still an issue then please share the details of issue incurring on your end so that we may proceed further to help you out.

Hi Mudassir,

Thanks for the response, I am using version, but somehow I managed to get the emails. However, I have issue with attachments it is reading only 3 attachments. How can I solve this, Please help me on this.


Again, I suggest you to please test the same missing attachment issue using Aspose.Email. If it is still reproduced, please share the source MSG file and used sample code with us. We will try to investigate further on our end to help you out.