代码之家  ›  专栏  ›  技术社区  ›  Himanshu sharma

如何从EWS API获取sharedmailbox邮件?

  •  1
  • Himanshu sharma  · 技术社区  · 7 年前

    我可以通过这个C代码获得sharedmailbox邮件,但我也需要相同的API。EWS服务器是否提供了这样的API。

    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 回复  |  直到 7 年前
        1
  •  0
  •   Himanshu sharma    7 年前

    你可以用这个。您可以这样提到共享邮箱。

    <?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>