public void SendTestErrorEmail() { try { TemplatedErrorEmail.SendExceptionEmail(new ExceptionEmailClass { AppException = new ApplicationException( @"Application threw an invalid program exception and will be terminated.") }); } catch (Exception e) { Logger.Error($"Error Details: {e.Message}\r\nStack: {e.StackTrace}"); } }
private static void SendTestMailMessage() { try { TemplatedErrorEmail.SendFinal("testbody", "Hello world"); Console.WriteLine("Sent"); } catch (Exception e) { Logger.Error($"Error Details: {e.Message}\r\nStack: {e.StackTrace}"); Console.WriteLine("Exception encountered. See log."); } finally { Console.ReadLine(); } }