Multiple BCC in MailAddress RRS feed

  • Question

  • Hi,

    I have this line:

    mail_message.CC.Add(new MailAddress("employee_1_email@company.com", "Employee_1 Name"));
    mail_message.CC.Add(new MailAddress("employee_2_email@company.com", "Employee_2 Name"));

    I am moving the employee name and emails to a database, table name receipt_recipients with two fields:

    1. employee_name
    2. employee_email

    I want to populate the above Add MailAddress from the database table. Is it possible to add all in one line with semicolon just like when sending from any email client or the only way is to loop through records and add separate Add MailAddress?



    Monday, February 22, 2016 8:43 PM


  • You can add multiple e-mail addresses at a time using the overload of MailMessage.CC.Add that takes a String (not a MailAddress) as its argument. The String can contain a list of e-mail addresses separated by a comma "," (not a semi-colon).


    I don't think that this version allows you to include names as well as e-mail addresses.

    • Edited by Blackwood Monday, February 22, 2016 9:22 PM
    • Proposed as answer by Kristin Xie Friday, February 26, 2016 9:54 AM
    • Marked as answer by DotNet Wang Friday, March 4, 2016 2:28 AM
    Monday, February 22, 2016 9:21 PM

All replies