Kashif Iqbal November 21, 20170 Comments

Work with Extended Attributes of Messages using Exchange Web Service

Work with Extended Attributes of Messages using Exchange Web Service

November 21, 2017
Share on FacebookTweet about this on TwitterShare on LinkedIn

aspose-email-for-.NETWe are pleased to announce the release of Aspose.Email for .NET 17.11. This month’s release introduces a new feature of working with Extended Attributes using the API’s EWS client. It also fixes several bugs that further improve the overall API functionality. For a detailed note on what is new and fixed, please visit the release notes section of API documentation.

Create, Retrieve and Update Extended Attributes using EWS

This release of API brings an exciting feature where messages from Exchange server can retrieved as Outlook Messages. This implies that you can manipulate extended attributes of messages using the API’s EWS client. You can create, retrieve and update extended attributes using the EWS API. The retrieved item is obtained as MapiMessage from Exchange server and contains all the attributes information contained in the message.

Functional usage of this feature is as illustrated in code sample below.

NetworkCredential credential = new NetworkCredential(username, password, domain);
IEWSClient client = EWSClient.GetEWSClient(mailboxURI, credential);
{
    try
    {
        //Create a new Property
        PidNamePropertyDescriptor pd = new PidNamePropertyDescriptor(
            "MyTestProp",
            PropertyDataType.String,
            KnownPropertySets.PublicStrings);
        string value = "MyTestPropValue";

        //Create a message
        MapiMessage message = new MapiMessage(
            "from@domain.com",
            "to@domain.com",
            "EMAILNET-38844 - " + Guid.NewGuid().ToString(),
            "EMAILNET-38844 EWS: Support for create, retrieve and update Extended Attributes for Emails");

        //Set property on the message
        message.SetProperty(pd, value);

        //append the message to server
        string uri = client.AppendMessage(message);

        //Fetch the message from server
        MapiMessage mapiMessage = client.FetchMapiMessage(uri, new PropertyDescriptor[] { pd });

        //Retreive the value from Message
        string fetchedValue = mapiMessage.NamedProperties[pd].GetString();
    }
    finally
    {
    }
}

Other Improvements

This release also includes fixes to several API malfunctions related to various functional areas. Fixing these not only improves the overall usability of the API, but also adds to the overall stability of the 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