如何从EWS api获取sharedmailbox邮件?

时间:2018-06-19 08:10:42

标签: c# exchange-server exchangewebservices exchange-server-2010 exchange-server-2013

我可以通过这个C#代码获取sharedmailbox邮件,但我想要api相同。这是EWS服务器提供的。

FolderId SharedMailbox = new FolderId(WellKnownFolderName.Inbox,"Shared@domain.com");
ItemView itemView = new ItemView(1000);
service.FindItems(SharedMailbox,itemView);

我看到有些东西可以提供我的邮箱详情

https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/findconversation-operation

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010_SP1" />
  </soap:Header>
  <soap:Body>
    <m:FindConversation>
      <m:IndexedPageItemView BasePoint="Beginning" MaxEntriesReturned="1" Offset="0"/>
      <m:ParentFolderId>
        <t:DistinguishedFolderId Id ="inbox"/>
      </m:ParentFolderId>
    </m:FindConversation>
  </soap:Body>
</soap:Envelope>

我希望我的共享邮箱邮件也一样。

共享邮箱邮件是否有这样的api?

1 个答案:

答案 0 :(得分:0)

您可以使用它。您可以像这样提及共享邮箱。

<?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
                     xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
                     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
        <soap:Header>
          <t:RequestServerVersion Version="Exchange2013" />
        </soap:Header>
        <soap:Body>
          <m:FindConversation>
            <m:IndexedPageItemView MaxEntriesReturned="1" Offset="0" BasePoint="End" />
            <m:ParentFolderId>
              <t:DistinguishedFolderId Id="inbox" >
               <t:Mailbox>
                  <t:EmailAddress>sharedmail@mail.com</t:EmailAddress>
                </t:Mailbox>
              </t:DistinguishedFolderId>
            </m:ParentFolderId>
          </m:FindConversation>
        </soap:Body>
      </soap:Envelope>