2
votes

In EWS, you can create a draft like this:

<tns:CreateItem MessageDisposition="SaveOnly">
  <tns:Items>
    <t:Message>
      <t:ItemClass>IPM.Note</t:ItemClass>
      <t:Subject>subject</t:Subject>
      <t:Body BodyType="HTML">body</t:Body>
      <t:IsRead>false</t:IsRead>
    </t:Message>
  </tns:Items>
</tns:CreateItem>

What do I need to add to create a regular message instead of a draft, as the code above does (using SOAP messages, not the Managed API)?

1

1 Answers

6
votes

Setting the extended MessageFlags property did the trick! Has to be done at creation.

<tns:CreateItem MessageDisposition="SaveOnly">
  <tns:Items>
    <t:Message>
      <t:ItemClass>IPM.Note</t:ItemClass>
      <t:Subject>subject</t:Subject>
      <t:Body BodyType="HTML">body</t:Body>
      <t:IsRead>false</t:IsRead>
      <t:ExtendedProperty> 
        <t:ExtendedFieldURI PropertyTag="3591" PropertyType="Integer" /> 
        <t:Value>1</t:Value> 
      </t:ExtendedProperty>
    </t:Message>
  </tns:Items>
</tns:CreateItem>