Пример #1
0
        public ActionResult Test(string q)
        {
            if (AuthContext.CurrentContext.CurrentUser == null)
                return View("Login");

            var hosts = new Hosts();
            var path = AppDomain.CurrentDomain.BaseDirectory + "MailHosts.xml";
            var sender = new NewsSenderManager(hosts.Load(path));
            sender.TestAllHosts(new Recipient{Name = q, Email = q});

            return View("Index", new MailingModel { SendReturn = "Um e-mail de teste foi enviado usando cada um dos SMTPs configurados." });
        }
Пример #2
0
 static void TestAll()
 {
     var hosts = new Hosts();
     var path = AppDomain.CurrentDomain.BaseDirectory + "MailHosts.xml";
     var newsSender = new NewsSenderManager(hosts.Load(path));
     newsSender.TestAllHosts(new Recipient {Email = "*****@*****.**", Name = "chalk"});
     Console.WriteLine("Sent Test");
     Console.Read();
 }