Skip to content

Instantly share code, notes, and snippets.

@jesulink2514
Created January 4, 2016 22:47
Show Gist options
  • Save jesulink2514/70646875be9e52bf5323 to your computer and use it in GitHub Desktop.
Save jesulink2514/70646875be9e52bf5323 to your computer and use it in GitHub Desktop.
WcfDemoMail - Servicio WCF de ejemplo para el proyecto de Handlebars
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