managed-ews

In EWS, how to get message's both plain-text and HTML bodies as strings keeping the original character encoding

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-07 07:41:32
问题 I'm working with Exchange 2010 (not Exchange 2013 which lets the caller request both plain-text and HTML bodies directly). To get HTML body, I'm using something like: ExtendedPropertyDefinition PR_BODY_HTML = new ExtendedPropertyDefinition(0x1013, MapiPropertyType.Binary); ExtendedPropertyDefinition PR_INTERNET_CPID = new ExtendedPropertyDefinition(0x3FDE, MapiPropertyType.Long); PropertySet properties = new PropertySet(BasePropertySet.FirstClassProperties); properties.RequestedBodyType =

FindItems() and BindToItems() give inconsistent results for EmailMessage.Sender.Address

亡梦爱人 提交于 2019-12-23 20:13:21
问题 After quite a lot of debugging, I've refined a complicated Managed EWS problem down to the following two simple-ish test cases. The first one works, the second one fails: var view = new ItemView(100) { PropertySet = new PropertySet { EmailMessageSchema.Id } }; var findResults = ews.FindItems(WellKnownFolderName.Inbox, view) var bindResults = ews.BindToItems(findResults.Select(r => r.Id), new PropertySet { EmailMessageSchema.Sender }); // Sanity check Assert.AreEqual(1, bindResults.Count()); /