Ejemplo n.º 1
0
 private static void SendEmailToEachUser(EmailDto emailDto, List <User> users, SmtpClient smtp)
 {
     foreach (var user in users)
     {
         MailAddress from = new MailAddress("*****@*****.**", "Internal mail");
         MailAddress to   = new MailAddress(user.Email);
         MailMessage m    = new MailMessage(@from, to);
         m.Subject = emailDto.Subject;
         m.Body    = emailDto.Text;
         smtp.Send(m);
     }
 }