0 votes
by (160 points)

I am using following c# code to get an e-mail from exchange

var messageInfo = client.GetMessageInfo(item.Id, EwsItemFields.Envelope | EwsItemFields.Body);
...
var text = messageInfo.Body.Content;

Because of security reasons i always need the body content as text an not as html.

When using EWS (Microsoft) i can define a PropertySet and set the RequestBodyType as follows

ps.RequestedBodyType = BodyType.Text

How can i do this with Rebex Ews

Applies to: Rebex Secure Mail

2 Answers

+1 vote
by (15.2k points)
selected by
 
Best answer

Thank you for the info. It turned out that adding support for downloading plain text body of a message (if the message contains it) for all Exchange server versions is easy enough to add. Here is a link to a trial version of a beta build. (I sent a link to full version of this beta to your email.)

The beta build contains new EwsItemFields.TextBody enum value that makes it possible to download plain text body of a message the same way as EwsItemFields.Body does. The value (if it is returned by the server) is stored in EwsMessageInfo.TextBody property.

0 votes
by (15.2k points)

Hi,

Specifying plain text to be retrieved is not supported yet, but it should not be hard to add. Actually, we did some testing and find out that different exchange servers needs different request to get plain text message body. Can you please tell which exchange server version are you communicating with? For example, Exchange 2010 with service pack 2 is enough. With this information, we can add support for your version and build you custom beta and add support for other Exchange servers later.

by (160 points)
The software communicates to Exchange 2010 SP3.
...