sending an email and validating input fields