How to ensure that valid email address is input in form?