Changed how email is validity is checked

Try…catch instead of if statement.