refactoring: creating MailSender class to handle sending and validating emails