【发布时间】:2016-11-09 13:03:17
【问题描述】:
我有以下情况: 我检查了一个邮箱,其中包含一些相关信息的电子邮件被发送到该邮箱,以从中获取信息。
我使用了很多搜索过滤器来查找特定的电子邮件并获得正确的电子邮件:
var collection = new SearchFilter.SearchFilterCollection(LogicalOperator.And);
collection.Add(new SearchFilter.ContainsSubstring(ItemSchema.Body, "text1", ContainmentMode.Substring, ComparisonMode.Exact));
collection.Add(new SearchFilter.ContainsSubstring(ItemSchema.Body, "text2", ContainmentMode.Substring, ComparisonMode.Exact));
collection.Add(new SearchFilter.ContainsSubstring(ItemSchema.Body, "text3", ContainmentMode.Substring, ComparisonMode.Exact));
collection.Add(new SearchFilter.ContainsSubstring(ItemSchema.Body, "text4", ContainmentMode.Substring, ComparisonMode.Exact));
collection.Add(new SearchFilter.ContainsSubstring(ItemSchema.Body, "text5", ContainmentMode.Substring, ComparisonMode.Exact));
collection.Add(new SearchFilter.ContainsSubstring(ItemSchema.Body, "longer string 1", ContainmentMode.Prefixed, ComparisonMode.IgnoreCase));
但现在我遇到的问题是我并不总是能找到正确的电子邮件。我非常简单地测试了这一点:我向我正在轮询的邮箱发送了一条消息,该邮箱看起来与另一条消息完全一样。在这两种情况下,上面的所有信息都包括在内。 但是,在我更改了 SearchFilters 上的某些内容或任何内容后,我突然看到了正确的结果,即最新消息。
我不知道是什么导致了这个问题,因为它太不通用了。
【问题讨论】:
标签: c# .net exchangewebservices ews-managed-api