Parsing the details via DotNet in efficient manner

Hello @Devishree,

Aspose.Email does not provide a direct method to retrieve a list of MessageInfo objects based on a given list of entity IDs. However, you can achieve this by iterating over the folder’s message collection and filtering messages based on their IDs.
You can iterate through messages in a folder and filter by entity ID:

FolderInfo folderInfo = pst.RootFolder.GetSubFolder("Inbox");
MessageInfoCollection messages = folderInfo.GetContents();

List<string> entityIds = new List<string> { "id1", "id2" }; // Replace with actual IDs
List<MessageInfo> filteredMessages = messages.Where(m => entityIds.Contains(m.EntryIdString)).ToList();

For retrieving messages in the current folder based on a conversation ID, you can refer to our blog article Group Messages from PST by Conversation Threads using C# .NET. This article explains how to use MAPI properties such as PidTagConversationIndex to identify and group messages into conversations.
Additionally, you can check out the ConversationThread sample app in our GitHub repository. This project provides a practical implementation of grouping messages by conversation.

Hi @margarita.samodurova for folder parsing i need to extract mail related folders alone to achieve this can i rely on the ContainerClass property of the PersonalStorage object ? If no how to achieve this?

Hello @Devishree,

Yes, you can rely on the ContainerClass property of the FolderInfo object. Mail-related folders typically have the ContainerClass set to "IPF.Note". You can use this value to filter out mail folders when parsing the PST.

But i could see empty values for certain folders is this expected?
Image File.png (4.9 KB)

Yes, some folders can have an empty ContainerClass value.

Usually, an empty ContainerClass implies “IPF.Note”, meaning the folder is likely a mail folder. However, for greater reliability, you can extract one item from the folder and check its message class (MapiMessage.MessageClass). If it is “IPM.Note”, then the folder contains mail items.

Hi @margarita.samodurova how do i differentiate inline images and attachment in MapiAttachment, i could notice for a specific file IsInlineImage property always return false even for inline image

Hello @Devishree,

Could you please provide a sample MSG file where an inline image exists, but the IsInline property returns false? This would help us analyze the issue.

Outlook (2).zip (655.3 KB)
Inbox folder has mail with subject HTML body, this mail has around 12 inline images all are sent as attachments

Hi @margarita.samodurova is there any property that represents total number of thread count for a conversation ?

Thank you for providing pst file. We are investigating this issue and will update you on our findings.

No, there isn’t a direct MAPI property that represents the total number of messages (thread count) in a conversation.

okay thanks, TryToGetFolderById() this method in PersonalStorage will this give me folder info even it is a subFolder ?

Hello @Devishree.

Yes, TryToGetFolderById() in PersonalStorage will return folder information even if the folder is a subfolder. This method searches for a folder by its entry ID within the entire PST file hierarchy, not just at the root level.

Hi @margarita.samodurova thanks for the above confirmation, is there any property available in MapiMessages that is equivalent of EntryIdString of MessageInfo ?

Hello @Devishree,

No, the MapiMessage class does not have a property equivalent to the EntryIdString of MessageInfo.
Note, that once a message is extracted from a PST file, it is no longer associated with any storage. Therefore, the EntryId does not have any meaning for an individual MapiMessage, as this identifier is only relevant within the PST file.
However, when working with a PST file, you can obtain the EntryId of a message using MessageInfo before extracting the MapiMessage.

@Devishree

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): EMAILNET-41537

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi @margarita.samodurova, how should i update just the read status of list of mails in particular folder is this achievable without getting existing flag value for each mail and updating the read status of it ? Also do we have any methods to delete all mails from a folder?

Hello @Devishree,

In a PST file, it is not possible to set the read status without first retrieving the existing flag value.

Here’s an example of how to delete emails from Inbox using the DeleteChildItems method.

using (PersonalStorage pst = PersonalStorage.FromFile("sample.pst"))
{
    // Get the target folder (e.g., Inbox)
    FolderInfo inbox = pst.RootFolder.GetSubFolder("Inbox");

    // Get all messages in the folder
    MessageInfoCollection messages = inbox.GetContents();

    // Collect Entry IDs of all messages
    List<string> entryIdList = new List<string>();
    foreach (MessageInfo message in messages)
    {
        entryIdList.Add(message.EntryId);
    }

    // Delete all collected messages at once
    if (entryIdList.Count > 0)
    {
        pst.DeleteChildItems(entryIdList);
    }
}

Hello @margarita.samodurova do we have any plans to support search with pagination ? Also do we have any doc on how to use orderByString param in MailQuery class

Hi @alexander.pavlov where can i track this issue status ?