public async Task <ActionResult> Index() { var emailer = new Emails.Mailer(); var str = await emailer.SendTestEmail("*****@*****.**", "Subject line", new TestViewData { Message = "Hi from WebApp.Netframework" }); return(Content(str)); }
static async Task Main(string[] args) { var emailer = new Emails.Mailer(); await emailer.SendTestEmail("*****@*****.**", "Subject line", new TestViewData { Message = "Hi from .Net framework console" }); Console.WriteLine("Done."); Console.WriteLine("Hit Enter..."); Console.ReadLine(); }