Beispiel #1
0
        public JsonResult EnviarReclamo(string Nombre, string Empresa, string Telefono, string Email, string Mensaje)
        {
            RespuestaJson respuesta = new RespuestaJson(false, "Ocurrio un Error, por Favor intente mas tarde");

            try
            {
                db.Reclamo.Add(new Reclamo()
                {
                    Nombre   = Nombre,
                    Empresa  = Empresa,
                    Telefono = Telefono,
                    Email    = Email,
                    Mensaje  = Mensaje
                });
                db.SaveChanges();

                var emailBody = "<b>Nombre</b>: " + Nombre + "<br/>" +
                                "<b>Empresa</b>: " + Empresa + "<br/>" +
                                "<b>Telefono</b>: " + Telefono + "<br/>" +
                                "<b>Email</b>: " + Email + "<br/>" +
                                "<b>Mensaje</b>: <br/>" + Mensaje + "<br/>";

                //Configuring webMail class to send emails
                //gmail smtp server
                WebMail.SmtpServer = "mail.xindicoweb.com.ar";
                //gmail port to send emails
                WebMail.SmtpPort = 587;
                WebMail.SmtpUseDefaultCredentials = true;
                //sending emails with secure protocol
                //WebMail.EnableSsl = true;
                //EmailId used to send emails from application
                WebMail.UserName = "******";
                WebMail.Password = "******";

                //Sender email address.
                WebMail.From = "*****@*****.**";

                //Send email
                WebMail.Send(to: "*****@*****.**", subject: "Reclamo - XindicoWeb", body: emailBody, isBodyHtml: true);

                respuesta.resultado = true;
                respuesta.mensaje   = "El Reclamo se envio correctamente.";
            }
            catch (Exception)
            {
            }


            return(Json(respuesta, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
 //private readonly IServicioMensajes servicioMensajes;
 public ServicioEnviarMensaje(IServicioConexion servicioConexion, IServicioLog servicioLog)
 {
     _servicioConexion = servicioConexion;
     _servicioLog      = servicioLog;
     _respuesta        = new RespuestaJson();
 }