public ActionResult Admin(string MessageHtmlContent, string submit) { switch (submit) { case "SaveRegMessage": db.SetParameterValue(ParameterType.RegMessageContent, MessageHtmlContent); break; case "SendMessage": using (SmtpClient client = new SmtpClient()) { MailMessage message = new MailMessage("*****@*****.**", "*****@*****.**"); message.Subject = "Message from GTDoro.com"; message.Body = MessageHtmlContent; message.IsBodyHtml = true; foreach (ApplicationUser u in db.Users) { message.Bcc.Add(u.UserName); } client.Send(message); TempData["UpdateInfo"] = Settings.MSG_SUCCESSFUL_OPERATION; } break; } return(RedirectToAction("Admin")); }