I am trying to send WebMail.Send() email to multiple email IDs. The MSDN library page clearly states that multiple email identifiers should be separated by a semicolon (;). However, when I try to send letters to multiple identifiers, I get a FormatException with a message that says "An invalid character was found in the mail header: ';' However, if I send mail to one receiver, the mail is delivered correctly.
So how to send mail to multiple recipients using WebMail.Send() ? Perhaps I am missing something very obvious.
Edit: Here is the code I'm using.
string [] selectedUserIds = GetEmailIds(); string to = string.Join(";", selectedUserIds); WebMail.Send(to: to, subject: subject, body: message, cc: cc, filesToAttach: attachments, isBodyHtml:true);
Jatin source share