I'm trying to read the content of an email in HTML. My problem though, is that my body is not very unique though I'm loading the EmailMessageSchema.UniqueBody
.
Here's my expected solution:
var props = new PropertySet(BasePropertySet.IdOnly,
EmailMessageSchema.UniqueBody,
EmailMessageSchema.Subject,
EmailMessageSchema.To,
EmailMessageSchema.From
/*Futher properties if needed*/);
props.RequestedBodyType = BodyType.HTML;
var message = EmailMessage.Bind(subscription.Service, item.ItemId, props);
// Should be unique
var uniqueBody = message.UniqueBody.Text;
When debugging and investigate my uniqueBody
variable, I can clearly see that this is not unique. It takes the entire body of the email prior to the current email (as the current email is a response, i wouldn't expect to get the content of the email responded to).
I'm not sure I understand the concept of the EmailMessageSchema.UniqueBody
property, or perhaps I'm simply doing something wrong?
So, how do I get the unique body of a reply email, without it's parents body?