使用ews搜索带有FindItem的邮件附件

问题描述 投票:0回答:1

我尝试在具有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"它有效。如何与其他搜索词一起搜索附件?

exchange-server exchangewebservices
1个回答
0
投票

您不能使用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,您的请求应类似于]

© www.soinside.com 2019 - 2024. All rights reserved.