在 EWS 中添加超过 "ReplyAll" 的收件人

Adding recipients beyond "ReplyAll" in EWS

如果我想在EWS中回复邮件的所有收件人,我可以使用以下XML:

<tns:CreateItem MessageDisposition="SendAndSaveCopy">
  <tns:SavedItemFolderId>
    <t:DistinguishedFolderId Id="sentitems"/>
  </tns:SavedItemFolderId>
  <tns:Items>
    <t:ReplyAllToItem>
      <t:ReferenceItemId Id="MailId" ChangeKey="MailChangeKey" />
      <t:NewBodyContent BodyType="HTML">body</t:NewBodyContent>
    </t:ReplyAllToItem>
  </tns:Items>
</tns:CreateItem>

效果很好。但是请考虑您按下 "Reply all" 按钮并添加一些应该接收邮件的额外电子邮件地址的情况。

我应该如何更改 XML 才能使其正常工作?

看看MessageDispositionType。通过在行 中设置 MessageDisposition=SaveOnly,您可以创建草稿。然后,您可以使用所需的其他收件人更新草稿,并通过调用 UpdateItem 并设置 MessageDispostion=SendAndSaveCopy 来发送消息。