Created
January 4, 2016 22:47
-
-
Save jesulink2514/70646875be9e52bf5323 to your computer and use it in GitHub Desktop.
WcfDemoMail - Servicio WCF de ejemplo para el proyecto de Handlebars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Mail; | |
using System.Runtime.Serialization; | |
using System.ServiceModel; | |
using System.Text; | |
using WcfDemoMail.Mail; | |
namespace WcfDemoMail | |
{ | |
public class BussinesDemoService : IBussinesDemoService | |
{ | |
public void DoWork() | |
{ | |
var data = new WelcomeDetails() | |
{ | |
Name = "Jesus Angulo", | |
Date = DateTime.Now.ToLongDateString(), | |
Message = "Bienvenido a nuestro sistema Mail.NET" | |
}; | |
var bodyHtml = MailGenerator.GetHtml(data, "Welcome.html"); | |
var smtpClient = new SmtpClient(); | |
var message = new MailMessage("no-reply@somostechies.com", "alguien@outlook.com") | |
{ | |
Subject = "Bienvenido", | |
Body = bodyHtml, | |
IsBodyHtml = true | |
}; | |
smtpClient.Send(message); | |
} | |
} | |
public class WelcomeDetails | |
{ | |
public string Name { get; set; } | |
public string Date { get; set; } | |
public string Message { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment