FolderInfo.EnumerateMessages
EnumerateMessages()
Retrieves MessageInfo
objects from the folder.
public IEnumerable<MessageInfo> EnumerateMessages()
Return Value
An enumerable collection of all MessageInfo
objects in the folder, excluding folder associated information (FAI) items.
Remarks
Use this method to iterate through all messages in the folder without applying any filters or limits. Folder associated information (FAI) items, such as hidden metadata or configuration items, are not included in the returned collection.
See Also
- class MessageInfo
- class FolderInfo
- namespace Aspose.Email.Storage.Pst
- assembly Aspose.Email
EnumerateMessages(MailQuery)
Retrieves a collection of MessageInfo
objects that match the specified query.
public IEnumerable<MessageInfo> EnumerateMessages(MailQuery mailQuery)
Parameter | Type | Description |
---|---|---|
mailQuery | MailQuery | The query criteria used to filter messages. |
Return Value
An enumerable collection of MessageInfo
objects matching the query.
Remarks
Use this method to retrieve messages that satisfy specific conditions, such as sender, subject, or date range, as defined by the mailQuery.
See Also
- class MessageInfo
- class MailQuery
- class FolderInfo
- namespace Aspose.Email.Storage.Pst
- assembly Aspose.Email
EnumerateMessages(MessageKind)
Retrieves a collection of MessageInfo
objects of the specified kind.
public IEnumerable<MessageInfo> EnumerateMessages(MessageKind kind)
Parameter | Type | Description |
---|---|---|
kind | MessageKind | The type of items to retrieve, such as normal messages or folder associated information items. |
Return Value
An enumerable collection of MessageInfo
objects of the specified kind.
Remarks
Use this method to filter items based on their type, such as distinguishing between messages or Folder Associated Information items.
See Also
- class MessageInfo
- enum MessageKind
- class FolderInfo
- namespace Aspose.Email.Storage.Pst
- assembly Aspose.Email
EnumerateMessages(int, int)
Retrieves a collection of MessageInfo
objects starting from a specific index and limited to a specified count.
public IEnumerable<MessageInfo> EnumerateMessages(int startIndex, int count)
Parameter | Type | Description |
---|---|---|
startIndex | Int32 | The zero-based index of the first message to retrieve. |
count | Int32 | The maximum number of messages to retrieve. If set to -1 , retrieves all messages starting from the specified startIndex. |
Return Value
An enumerable collection of MessageInfo
objects starting at the specified index.
Remarks
Use this method to fetch a subset of messages from the folder, which is useful for paginated retrieval or scenarios requiring controlled message processing. When count is set to -1
, all messages from startIndex to the end of the folder are returned.
See Also
- class MessageInfo
- class FolderInfo
- namespace Aspose.Email.Storage.Pst
- assembly Aspose.Email