Cannot create 'DistributionList' recipient using EWS Managed API RRS feed

  • Question

  • I need to copy data from MAPI IMessage interface to online Exchnage mailbox using EWS Managed API. And I'm stuck with recipients. I cannot create MAPI_DISTLIST recipient (PidTagObjectType equals 8). Here is how I'm creating a recipient (just an example):

    var newMessage = new EmailMessage(service);
    newMessage.ItemClass = "IPM.Note";
    var emailAddress = new EmailAddress(name, email, addressType);
    emailAddress.MailboxType = MailboxType.PublicGroup;

    I'm trying different MailboxType (PublicGroup, ContactGroup, etc.) But seems setting MailboxType has no effect. New recipient is always MAPI_MAILUSER (PidTagObjectType equals 6).

    <Trace Tag="EwsRequest" Tid="1" Time="2016-10-12 11:17:16Z" Version="">
      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope ...>
          <m:CreateItem MessageDisposition="SaveOnly">
              <t:FolderId Id="id..." ChangeKey="key..." />
                    <t:Name>iTransition: TradingPartners Team</t:Name>

    Here is EWS request:I've checked the PR_OBJECT_TYPE property of the created recipient using MFCMAPI. And it was equal (MAPI_MAILUSER) But should be equal 8 (MAPI_DISTLIST).

    • Edited by borzykot Thursday, October 13, 2016 8:10 AM
    Wednesday, October 12, 2016 3:35 PM