Server-side validation and sending email