Beispiel #1
0
        private MailMessage GetContactMailMessage(ContactDTO contactDTO)
        {
            var mailMessage = new MailMessage();

            mailMessage.To.Add(new MailAddress(ConfigurationManager.AppSettings["SMTPUsername"]));
            mailMessage.From    = new MailAddress(ConfigurationManager.AppSettings["SMTPUsername"]);
            mailMessage.Subject = "Evaluando Software - Contacto";

            mailMessage.Body  = "";
            mailMessage.Body += "<table>";
            mailMessage.Body += "<tr><th>Nombre</th><td>" + contactDTO.FirstName + "</td></tr>";
            mailMessage.Body += "<tr><th>Apellido</th><td>" + contactDTO.LastName + "</td></tr>";
            mailMessage.Body += "<tr><th>Empresa</th><td>" + contactDTO.Company + "</td></tr>";
            mailMessage.Body += "<tr><th>Email</th><td>" + contactDTO.Email + "</td></tr>";
            mailMessage.Body += "<tr><th>Motivo</th><td>" + contactDTO.Reason + "</td></tr>";
            mailMessage.Body += "<tr><th>Mensaje</th><td>" + contactDTO.Message + "</td></tr>";
            mailMessage.Body += "</table>";

            mailMessage.IsBodyHtml = true;

            return(mailMessage);
        }
Beispiel #2
0
        public void SendContactEmail(ContactDTO contactDTO)
        {
            var mailMessage = this.GetContactMailMessage(contactDTO);

            this.Send(mailMessage);
        }