I have a plugin that sends an email where we routinely need to add/remove people to the email list. Some of these people are CRM users, some are not.
I have a configuration entity that I want to reference a field that contains a string of all of the email addresses that I want to email. Here I can add and remove emails easily without having to promote a new piece of code or have to create multiple fields for each individual email.
I found the code below where you can enter in an email address to email someone that is not a user or contact in CRM. However, if I enter in two email addresses like in the commented code below, it only emails the last email address.
Can you help me email more than one person from one field? If not, do you have a better suggestion to handle this? Thank you in advance.
// Create a new unresolved activity party
Entity party2 = new Entity("activityparty");
party2["addressused"] = "unresolved@email.com";
//Does Not Work, only emails last email address
//party2{"addressedused"} = "unresolved@email.com;testperson@email.com";
// Create a new EntityCollection and add the 2 parties
EntityCollection to = new EntityCollection();
to.Entities.Add(party2);