static void Main(string[] args)
        {
            Console.WriteLine(@"
This a very simple demo of how the NonHttpRunTimeRazorSupport library 
might be used to send emails outside of the context of a running
web application.

This app is configured to drop .eml files in the C:\temp folder (see 
app.config). These files can be viewed in an email client, or on a
web site like http://www.encryptomatic.com/viewer/Default.aspx");
            var settings = new NotificationSettings(new Uri("http://www.facepack.com/"));
            var service = new EmailNotificationService(settings);
            do
            {
                var from = new MailAddress("*****@*****.**");
                var to = new MailAddress("*****@*****.**");
                var model = new WelcomeModel
                {
                    Name = "Dave"
                };
                service.Send(from, to, model);
                Console.WriteLine("Message sent. Press a key to resend, or q to exit");
            } while (Console.ReadKey().KeyChar != 'q');
        }
Exemplo n.º 2
0
 public EmailNotificationService(NotificationSettings settings)
 {
     this.settings = settings;
 }