UniqueBody is empty when Body is not

I inherited the responsibility for the project from a previous developer who accepts incoming letters and processes them into customer support subscriptions.

It basically works fine, but it has problems with one specific email address, and I can't figure out why. In Outlook, a letter clearly has a body (short text, image, and signature). This is a new message, not a response. The version of the Exchange server is 2013.

But when the processing of the code below is UniqueBodyempty, but Bodycontains the correct text. This does not happen with any other messages I have encountered on this server.

if (serverVersion >= ExchangeVersion.Exchange2010)
    body = msg.UniqueBody.Text;
else
    body = msg.Body.Text;

What would make UniqueBody empty and Body not?

Why did the previous developer prefer to use UniqueBody over Body, how are they different?

Could this be related to this?

+4
source share
1 answer

Verify that the property request is correct:

PropertySet ps = new PropertySet(ItemSchema.UniqueBody);
var email = EmailMessage.Bind(service, item.ItemId, ps);

If you do this, UniqueBody-Property should not be empty.

As far as I know, it UniqueBodyshould be installed by the Exchange server to show you how much mail is related to your ticket: https://msdn.microsoft.com/en-us/library/office/dd877075(v=exchg.150). aspx

If your client answers the call later, you only need the new text. With the new mail / ticket: body == uniqueBody == "the text you want to use".

0
source

Source: https://habr.com/ru/post/1689383/


All Articles