public IActionResult sendemails(string[] ids) { var sendMailViewModel = new SendMailViewModels { Ids = ids }; return(View("sendemails", sendMailViewModel)); }
public IActionResult sendemails(SendMailViewModels model) { try { foreach (var id in model.Ids) { var mailrecive = _emailRegister.GetEmail(id); EmailSender.SendMail(mailrecive.Email, model.Subject, model.Content); } } catch (Exception) { } return(RedirectToAction("getemail")); }