Kashif Iqbal December 26, 20160 Comments

Filtering Tasks by Status supported with Aspose.Email for .NET 16.12.0

Filtering Tasks by Status supported with Aspose.Email for .NET 16.12.0

December 26, 2016
Share on FacebookTweet about this on TwitterShare on LinkedIn
Aspose.Email for .NET We are pleased to announce the release of Aspose.Email for .NET 16.12.0. This month’s release includes a number of enhancements for working with tasks on Exchange server and searching messages by specifying date time. It also fixes a number of bugs related to the API that further improves the overall API functionality. For complete list of what is new and fixed in this month’s release, please visit the Release Notes section of Aspose.Email for .NET documentation.

Enhancements

Filtering Tasks from Exchange Server: Aspose.Email for .NET API already supports fetching tasks from Exchange server. This month’s release further enhances the capabilities of fetching tasks using Exchange Web Service (EWS) by providing filtering capabilities. This allows to retrieve only those tasks from server that meet specific user criterion for task status. The possible statuses include:
  • Completed
  • Deferred
  • In Progress
  • Not Started
  • Waiting on others
The TaskStatus property of ExchangeQueryBuilder class can be used to specify a single status or a combination of statuses to be retrieved from the server as shown in the following code sample:

IEWSClient client = EWSClient.GetEWSClient("exchange.domain.com", "username", "password");

ExchangeQueryBuilder queryBuilder = null;
MailQuery query = null;
ExchangeTask fetchedTask = null;
ExchangeMessageInfoCollection messageInfoCol = null;
client.TimezoneId = "Central Europe Standard Time";
Array values = Enum.GetValues(typeof(ExchangeTaskStatus));

//Now retrieve the tasks with specific statuses
foreach (ExchangeTaskStatus status in values)
{
    queryBuilder = new ExchangeQueryBuilder();
    queryBuilder.TaskStatus.Equals(status);
    query = queryBuilder.GetQuery();
    messageInfoCol = client.ListMessages(client.MailboxInfo.TasksUri, query);
    fetchedTask = client.FetchTask(messageInfoCol[0].UniqueUri);
}

//retrieve all other than specified
foreach (ExchangeTaskStatus status in values)
{
    queryBuilder = new ExchangeQueryBuilder();
    queryBuilder.TaskStatus.NotEquals(status);
    query = queryBuilder.GetQuery();
    messageInfoCol = client.ListMessages(client.MailboxInfo.TasksUri, query);
}
Support for Filtering Messages by Date Time: This month’s release also enhances the API’s IMAP and EWS clients to filter messages from server by Time as well. Till yet, these provided the capability to filter messages from server based on date using the ExchangeQueryBuilder class. The implementation has been enhanced so that the comparison now considers the time part as well. The DateComparisonType.ByDateTime option serves this purpose for filtering messages using the MailQuery.

Other Improvements

This month’s release also fixes several bugs that were reported with the last month’s release by our valued customers. This further improves the API functionality and stability.

Worth Noticing

In addition to this month’s release, we have also published a revamped version of Aspose.Email for .NET that is based on a more improved namespace structure. The new version of the API will be published in parallel to this version, now known as legacy API, for three consecutive release so as to give customers ample time for migration to the new API.

API Resources

The following API resources can be of help to you in getting started with Aspose.Email API.

Leave a comment

Posted inAspose.Email Product Family
 

Related Articles