Exchange Web服务(EWS)FindItems在SearchFolder

时间:2016-04-01 12:30:17

标签: exchangewebservices ews-managed-api

我正在使用SearchFolder对连接到Office365的EWS进行深度遍历搜索。问题是,在为此文件夹使用FindItems时,我没有获得所有匹配的电子邮件结果。我没有收到包含“text”的HTML正文的电子邮件(对于Text body,它可以工作)。但是当我将FindItems用于普通文件夹时,它会返回所有电子邮件。

var subjectFilter = new SearchFilter.ContainsSubstring(ItemSchema.Subject, text, ContainmentMode.Substring, ComparisonMode.IgnoreCase);
var bodyFilter = new SearchFilter.ContainsSubstring(ItemSchema.Body, text, ContainmentMode.Substring, ComparisonMode.IgnoreCase);
var searchFilter = new SearchFilter.SearchFilterCollection(LogicalOperator.Or, subjectFilter, bodyFilter);
var findItems = service.FindItems(searchFolderID, searchFilter, view);

1 个答案:

答案 0 :(得分:-1)

您不能在FindItems请求中包含Body属性。 您需要浏览邮件列表,然后加载Body属性。 请参阅:https://stackoverflow.com/a/25840741/1364448