【问题标题】:Moving or Deleting an Outlook Message via the exchange EWS通过 Exchange EWS 移动或删除 Outlook 邮件
【发布时间】:2022-01-06 06:25:27
【问题描述】:

我正在使用 office.js 开发 Outlook 加载项,并尝试通过 EWS API(soap 信封)删除 a 中的消息。按照文档删除项目操作:https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/deleteitem-operation,不幸的是对我不起作用。我正在使用以下请求信封发出mailbox.makeEwsRequestAsync() 请求。也尝试移动到垃圾箱, 要求:

"<?xml version=""1.0"" encoding=""utf-8""?>
<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""
xmlns:m=""https://schemas.microsoft.com/exchange/services/2006/messages""
xmlns:t=""https://schemas.microsoft.com/exchange/services/2006/types""
xmlns:soap=""https://schemas.xmlsoap.org/soap/envelope/"">
  <soap:Header>
    <t:RequestServerVersion Version=""Exchange2013""/>
  </soap:Header>
  <soap:Body>
    <m:MoveItem>
      <m:ToFolderId>
        <t:DistinguishedFolderId Id=""deleteditems""/>
      </ m:ToFolderId>
      <m:ItemIds>
        <t:ItemId Id=""{0}""/>
      </m:ItemIds>
    </m:MoveItem>
  </soap:Body>
</soap:Envelope>"

任何帮助将不胜感激!谢谢!

【问题讨论】:

  • 对不起,我忘了评论发送请求时它返回远程服务器返回错误:(500)内部服务器错误。

标签: jquery api soap exchangewebservices outlook-web-addins


【解决方案1】:

目前,mailbox.makeEwsRequestAsync() 只能访问 here 列出的 EWS 操作子集。 DeleteItem 不受支持,将导致错误响应。还有其他方法可以删除项目,例如使用MoveItem,请参阅documentation了解更多详情。

【讨论】:

  • 非常感谢您的回答,我知道deleteitem这个操作是不能用的,请试试moveitem:docs.microsoft.com/en-us/exchange/client-developer/… ? redirectedfrom = MSDN,并发布了 SOAP 示例,但它也不起作用。返回:远程服务器返回错误:(500) Internal Server Error
猜你喜欢
  • 2021-03-12
  • 1970-01-01
  • 2014-03-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-08-10
  • 2016-11-15
  • 1970-01-01
相关资源
最近更新 更多