Tholle
Tholle

Reputation: 112897

Adding recipients beyond "ReplyAll" in EWS

If I want to reply to all the recipient of a mail in EWS, I can use the following 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>

This works great. But consider the scenario that you press the "Reply all" button and add a few extra email addressses that should recieve the mail.

How should I alter the XML to get this to work?

Upvotes: 1

Views: 186

Answers (1)

Venkat Ayyadevara - MSFT
Venkat Ayyadevara - MSFT

Reputation: 2893

Take a look at MessageDispositionType. By setting MessageDisposition=SaveOnly in the line , you can create a draft. Then, you can update the draft with the additional recipients you need, and send the message by calling UpdateItem and setting MessageDispostion=SendAndSaveCopy.

Upvotes: 2

Related Questions