I am trying WebMail.Send()
to send mail to multiple email ids. The MSDN library page clearly specifies that multiple email ids should be separated by semicolon(;). However when I try to send mails to multiple ids, I get FormatException
with Message that says
"An invalid character was found in the mail header: ';'. However if I send mail to single receipent, the mail gets delivered properly.
So, how do I send mails to multiple receipents using WebMail.Send()
? Perhaps I am missing something very obvious.
Edit: Here is the code that I am using.
string [] selectedUserIds = GetEmailIds();
string to = string.Join(";", selectedUserIds);
WebMail.Send(to: to, subject: subject, body: message, cc: cc, filesToAttach: attachments, isBodyHtml:true);