public async Task <IActionResult> Index() { var emailer = new Emails.Mailer(); var str = await emailer.SendTestEmail("*****@*****.**", "Subject line", new TestViewData { Message = "Hi from Webapp.NetCore" }); 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 core Console" }); Console.WriteLine("Done."); Console.WriteLine("Hit Enter..."); Console.ReadLine(); }