locked
[E2010] [EWSMA] [C#] Is it possible to get the body contents as text? RRS feed

  • Question

  • The email can be formatted as Text or HTML. Is there a way using EWS Managed API to get the contents of an email as plain text?

    I know EWS SDK has a ItemShape which allows the body to be requested as Text.

    Monday, October 24, 2011 5:07 PM

Answers

  • Hi, given the id of an element, you can use the RequestedBodyType property of the PropertySet class:

         var item = EmailMessage.Bind(service, id,
                                                            new
    PropertySet(BasePropertySet.FirstClassProperties)
                                                            {RequestedBodyType = BodyType.Text});

     Kind regards,
    Henning

    If you get your question answered, please come back and mark the reply as an answer.
    If you are helped by an answer to someone else's question, please mark it as helpful.

    • Marked as answer by vijayst Tuesday, October 25, 2011 4:36 AM
    Monday, October 24, 2011 9:06 PM