Howto: Example to retrieve the body property of a message using the Exchange Managed API.

 

        public string GetItemMime(ItemId oItemId)

        {

            string sReturn = string.Empty;

            PropertySet oMimePropertySet = new PropertySet(ItemSchema.MimeContent);

            Item oItem = Item.Bind(_ExchangeService, oItemId, oMimePropertySet);

            return   oItem.MimeContent.ToString() ;

            

        }

 

        public string GetItemMime(Item oItem)

        {

            PropertySet oMimePropertySet = new PropertySet(ItemSchema.MimeContent);

            oItem.Load(oMimePropertySet);

            return oItem.MimeContent.ToString();

 

        }

Comments

  • Anonymous
    May 20, 2012
    Is it possible to do this in VBScript?

  • Anonymous
    May 20, 2012
    Yes.  You would need to do an old-fashoned SOAP post - simlar to the one below - but you woudl need to use the XML request for getting the MIME.  Further, you would need to determine the CAS server URL to use - this going to be a point point for vbscript if there is more than on CAS server.  The Exchange Managed API figures it out by doing the Autodiscover Process when you call Autodiscover().   You will also need to write POST code to get you down to the item you want to work with - so, you will need to research the XML to used in the POST and responses if your going to use VBScript. blogs.msdn.com/.../howto-read-oof-info-using-ews-and-vbscript-against-an-exchange-2010-sp1.aspx