public static void Register(string email, string password) { MailService ms = new MailService(email, "User registration", "Body of message..."); SmsService ss = new SmsService("111 111 111", "User successfully registered..."); try { if (ms.ValidEmail()) { ms.SendNotification(); } ss.SendNotification(); } catch (Exception e) { Console.WriteLine(e.Message); throw; } }