I use the following code for add the userid in Email Entity To's field.If I enter the single value (a single user) in to field the following code will working fine.
Now, I need to add more than one user id in TO field which means i need to send multiple emails at a time.How can I add multiple to fields in CRM email Entity.
Entity email = new Entity();
EntityReference to = new EntityReference("systemuser", new Guid("<Guid Here>"));
//Derive to party
Entity toParty = new Entity("activityparty");
toParty.Attributes.Add("partyid", to);
EntityCollection collToParty = new EntityCollection();
collToParty.EntityName = "systemuser";
collToParty.Entities.Add(toParty);
email.Attributes.Add("to", collToParty);
Thanks in advance.
*This post is locked for comments