コード例 #1
0
        public IActionResult sendemails(string[] ids)
        {
            var sendMailViewModel = new SendMailViewModels
            {
                Ids = ids
            };

            return(View("sendemails", sendMailViewModel));
        }
コード例 #2
0
 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"));
 }