public ActionResult Contact(Contact contact) { var admins = from a in UserBL.AdminList(contact.ApplicationID) select a; foreach (var rr in admins) { Emails Emailadmin = new Emails(); Emailadmin.FromEmail = "*****@*****.**"; Emailadmin.ToEmail = rr.Email; Emailadmin.SubjectEmail = "MDA Oasis Alajuela - Contacto"; //Emailadmin.BodyEmail = "Buenas " + rr.FullName + "... Acaba de ingresar una consulta de " + contact.Email + " y es la siguiente: " + contact.Message + " Bendiciones..."; StringBuilder mailBody = new StringBuilder(); mailBody.AppendFormat("<h1>MDA - Oasis Alajuela</h1>"); mailBody.AppendFormat("<hr />"); mailBody.AppendFormat("Buenas {0}...", rr.FullName); mailBody.AppendFormat("<p>Acaba de ingresar una consulta de parte {0}</p>", contact.Email); mailBody.AppendFormat("<h3>Mensaje:</h3>"); mailBody.AppendFormat("<p> {0} </p>", contact.Message); mailBody.AppendFormat("<br />"); mailBody.AppendFormat("<h3>Bendiciones....</h3>"); Emailadmin.BodyEmail = mailBody.ToString(); MailMessage mmm = new MailMessage(Emailadmin.FromEmail, Emailadmin.ToEmail); mmm.Subject = Emailadmin.SubjectEmail; mmm.Body = Emailadmin.BodyEmail; mmm.IsBodyHtml = true; SmtpClient smtp2 = new SmtpClient(); smtp2.Send(mmm); } return(this.RedirectToAction("EmailConfirmation", new { email = contact.Email, AppID = contact.ApplicationID })); }