Validate email addresses, and fail if they are not valid.
Escape user-provided strings in email, to avoid XSS and other injection bugs.