void Application_End(object sender, EventArgs e)
 {
     //  Code that runs on application shutdown
     _messagesService.Stop();
     _emailService.Stop();
 }