private static void StartSmtpServer() { EmailServer emailServer; do { Console.WriteLine("Smtp Server running !!!"); emailServer = new EmailServer(IPAddress.Loopback, 25); emailServer.Start(); } while (emailServer != null); }
private static void Main(string[] args) { int counter = 0; EmailServer emailServer; do { if (counter == 0) { Console.WriteLine("Smtp Server running !!!"); counter++; } emailServer = new EmailServer(IPAddress.Loopback, 25); emailServer.Start(); while (emailServer.IsThreadAlive) { Thread.Sleep(500); } } while (emailServer != null); }