问题描述
我正在使用SearchFolder在连接到Office365的EWS上进行深度遍历搜索.问题是,在此文件夹中使用FindItems时,我没有得到所有匹配的电子邮件结果.我没有使用HTML正文包含文本"的电子邮件(对于正文"而言,它可以正常工作).但是,当我将FindItems用于普通文件夹时,它将返回所有电子邮件.
I'm using SearchFolder to do a deep traversal search on an EWS connected to Office365. The problem is that I don't get all the matching email results when using FindItems for this folder. I don't get emails with HTML body that contains "text" (for Text body it work). But when I using FindItems for a normal folder it return all emails.
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);
推荐答案
您不能在FindItems请求中包含Body属性.您需要浏览邮件列表,然后加载正文"属性.请参阅: https://stackoverflow.com/a/25840741/1364448
You can not include Body property in FindItems request.You need to browse the list of mails, then you load the Body property.See: https://stackoverflow.com/a/25840741/1364448
这篇关于Exchange Web服务(EWS)FindItems不在SearchFolder中按HTML正文查找电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!