SOAP Message to EWS to create mail as regular mail, not draft

百般思念 提交于 2019-12-02 03:27:40

问题


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:


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>


来源:https://stackoverflow.com/questions/31147045/soap-message-to-ews-to-create-mail-as-regular-mail-not-draft

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!