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;

    newMessage.ToRecipients.Add(emailAddress); newMessage.Save(targetFolder.Id);

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

    Here is EWS request:

    <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>

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

    • Edited by borzykot Wednesday, October 12, 2016 3:23 PM
    Wednesday, October 12, 2016 3:16 PM