public JsonResult Enviarcorreo(ContactoViewModel model) { var rm = new ResponseModel(); var _usuario = usuario.Obtener(FrontOfficeStartUp.UsuarioVisualizado()); if (ModelState.IsValid) { try { var mail = new MailMessage(); mail.From = new MailAddress(model.Correo, model.Nombre); mail.To.Add("*****@*****.**"); mail.Subject = "correo desde contacto"; mail.IsBodyHtml = true; mail.Body = model.Mensaje; var smtpServer = new SmtpClient("smtp.gmail.com"); smtpServer.Port = 587; smtpServer.DeliveryMethod = SmtpDeliveryMethod.Network; smtpServer.UseDefaultCredentials = false; smtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "125789463lda"); smtpServer.EnableSsl = true; smtpServer.Send(mail); } catch (Exception e) { rm.SetResponse(false, e.Message); return(Json(rm)); throw; } rm.SetResponse(true); rm.function = "CerrarContacto()"; } return(Json(rm)); }
public ActionResult PDF() { return(View(usuario.Obtener(FrontOfficeStartUp.UsuarioVisualizado(), true))); }