I have a class to send email, which works perfectly for only one recipient, however I need to send to several people, I made a select that searches the emails I need and places the ";". But when I try to send it this way, I get the error "An invalid character was found in the email header: ';'." I tried putting "," returns the same error.
I tried to do this:
var listaEmail = emailDestinatario;
var emails = listaEmail.Split(',');
foreach (var endereco in emails)
{
email.To.Add(endereco);
}
It does not return an error, but it also does not send the emails. Any suggestions?