我尝试在具有FindItem的Exchange Server上使用EWS搜索具有特定附件名称的邮件。
我通过以下请求摘录进行此操作:
<typ:Or>
<typ:Contains ContainmentMode="Substring" ContainmentComparison="Loose">
<typ:FieldURI FieldURI="message:Sender" />
<typ:Constant Value="Test" />
</typ:Contains>
<typ:Contains ContainmentMode="Substring" ContainmentComparison="Loose">
<typ:FieldURI FieldURI="message:ToRecipients" />
<typ:Constant Value="Test" />
</typ:Contains>
<typ:Contains ContainmentMode="Substring" ContainmentComparison="Loose">
<typ:FieldURI FieldURI="message:CcRecipients" />
<typ:Constant Value="Test" />
</typ:Contains>
<typ:Contains ContainmentMode="Substring" ContainmentComparison="Loose">
<typ:FieldURI FieldURI="message:BccRecipients" />
<typ:Constant Value="Test" />
</typ:Contains>
<typ:Contains ContainmentMode="Substring" ContainmentComparison="Loose">
<typ:FieldURI FieldURI="message:From" />
<typ:Constant Value="Test" />
</typ:Contains>
<typ:Contains ContainmentMode="Substring" ContainmentComparison="Loose">
<typ:FieldURI FieldURI="item:Subject" />
<typ:Constant Value="Test" />
</typ:Contains>
<typ:Contains ContainmentMode="Substring" ContainmentComparison="Loose">
<typ:FieldURI FieldURI="item:Body" />
<typ:Constant Value="Test" />
</typ:Contains>
<typ:Contains ContainmentMode="ExactPhrase" ContainmentComparison="Loose">
<typ:FieldURI FieldURI="item:Attachments" />
<typ:Constant Value="Test" />
</typ:Contains>
</typ:Or>
"item:Attachments"
我没有结果,但是例如"item:body"
它有效。如何与其他搜索词一起搜索附件?
您不能使用SearchFilter搜索需要使用QueryString查看的附件,而用法(AQS / KQL)请参见https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-perform-an-aqs-search-by-using-ews-in-exchange,您的请求应类似于]