How to restrict invalid email id's and phone numbers ?