Oki, so im working on outlook .msg templates. Opening them programmatically, inserting values base on what's in my db.
ex. when i want to add multiple reciepients at "To" field, instead of doing as following,
mailitem.To = a + ";" + b + ";" + c;
i do whats below, which is simpler, especially when i'm doing it in a loop.
mailitem.Recipients.add("a");
mailitem.Recipients.add("b");
mailitem.Recipients.add("c");
My problem is, i also want to add multiple recipients at "CC" field and the function above only works for "To" field. How can i add multiple recipients to "CC" field without having to do string manipulation.
normally i would add recipients to cc like so,
mailitem.CC = a + ";" + b + ";" + c;
im using interop.outlook and creating an mailitem from template.
Thanks in advance.
Suppose If you have two
List
of recipients, then you can do like this.Edit: Included full code.
Use the Recipients property as documented here (look for the second example). you can add a lot of people to the collection and then change the destination type from
to
toCC
.