使用EWS以代理身份访问收件箱时出现错误消息



我目前正试图访问一个邮箱,该邮箱已作为委托与我共享,如文档中所述。根据请求(来自文件(,

<?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=" Exchange2007_SP1" />
</soap:Header>
<soap:Body>
<m:CreateItem MessageDisposition="SaveOnly">
<m:SavedItemFolderId>
<t:DistinguishedFolderId Id="drafts">
<t:Mailbox>
<t:EmailAddress>email of my inbox</t:EmailAddress>
</t:Mailbox>
</t:DistinguishedFolderId>
</m:SavedItemFolderId>
<m:Items>
<t:Message>
<t:Subject>Company Soccer Team</t:Subject>
<t:Body BodyType="HTML">Are you interested in joining?</t:Body>
<t:ToRecipients>
<t:Mailbox>
<t:EmailAddress>inbox I want to access</t:EmailAddress>
</t:Mailbox>
</t:ToRecipients>
</t:Message>
</m:Items>
</m:CreateItem>
</soap:Body>
</soap:Envelope>

我总是收到的回复

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<h:ServerVersionInfo xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MajorVersion="15" MinorVersion="20" MajorBuildNumber="2430" MinorBuildNumber="27" Version="V2018_01_08" />
</s:Header>
<s:Body>
<m:FindFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<m:ResponseMessages>
<m:FindFolderResponseMessage ResponseClass="Error">
<m:MessageText>Mailbox does not exist.</m:MessageText>
<m:ResponseCode>ErrorNonExistentMailbox</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
</m:FindFolderResponseMessage>
</m:ResponseMessages>
</m:FindFolderResponse>
</s:Body>
</s:Envelope>

有人知道为什么回复说邮箱不存在吗?在Outlook中,我可以毫无问题地访问此邮箱。

您在中指定的邮箱

<m:SavedItemFolderId>
<t:DistinguishedFolderId Id="drafts">
<t:Mailbox>
<t:EmailAddress>email of my inbox</t:EmailAddress>
</t:Mailbox>
</t:DistinguishedFolderId>

是尝试将消息保存到的位置,因此该错误只是意味着您在此处使用的任何值都无效。您在中使用的值

<t:ToRecipients>
<t:Mailbox>
<t:EmailAddress>inbox I want to access</t:EmailAddress>
</t:Mailbox>
</t:ToRecipients>

将成为您创建的草稿消息的"收件人"字段

由于其中一个邮箱托管在Exchange Online上,而另一个则在内部部署,因此引发了错误消息。

相关内容

最新更新