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

Free Support Forum - aspose.com

Retrieving mail category from exchange

Hello


I need to retrieve the category of a mail.
I’ve successfully retrieved the email from exchange, but doesn’t seen any Category property on the MailMessage object.
Do you know how I could retrieve this information ?
I’m connected using EWS.

Thank you
Fabrice

Reading some of your documentation I finally found that I need to use a MapiMessage. So I wrote this code:

var message = this._client.FetchMessage(item.Id);
if (message != null)
{
var mapi = MapiMessage.FromMailMessage(message);
item.Category = string.Join(",", FollowUpManager.GetCategories(mapi).Cast().ToArray());
}

Problem : FollowUpManager.GetCategories(mapi) return an empty array.
I think I need to specify extended properties when fetching the email (FetchMessage have an overload that takes extended properties), but didn't found anything in your documentation.
Could you help me ?
How could I retrieve the Categories ?

Thank you

Hi Fabrice,


Thank you for contacting Aspose support team.

MapiMessage categories can be obtained using FollowUpManager which contains functions like GetCategories(), AddCategory(), RemoveCategory() and ClearCategory.

Following is a sample which demonstrate these features and if we have MailMessage then that need to be converted to MapiMessage. We can also observe that once the category is assigned, that can be obtained using GetCategories() function. Please give it a try and let us know your feedback.

MapiMessage msg = MapiMessage.FromFile(@“sample.msg”);

// add category
FollowUpManager.AddCategory(msg, “Purple Category”);


// add another category
FollowUpManager.AddCategory(msg, “Red Category”);

// retrieve the list of available categories
IList categories = FollowUpManager.GetCategories(msg);

// remove the specified category
FollowUpManager.RemoveCategory(msg, “Red Category”);

// clear all categories
FollowUpManager.ClearCategories(msg);

Thank you for your reply

But it seems I’ve posted while you were writing.
The problem here is not to read categories from a msg file, but to read it from an exchange email.
I’m already using FollowupManager but it returns an empty array.

Hi Fabrice,


I have tried this scenario and observed that category is not maintained in MailMessage while fetching message from exchange server. Please spare us little time as we are discussing this issue and will write back here as soon as some feedback is available in this regard.
Hi Fabrice,

I was able to reproduce this issue at my end using the latest version of Aspose.Email for .NET 4.7.0 and have logged it as enhancement ticket under id: NETWORKNET-34548 in our issue tracking system for further investigation by our development team. Once there is any information available in this regard, I'll update you here via this thread.

We are sorry for the inconvenience caused to you.

The issues you have found earlier (filed as NETWORKNET-34548) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.