Email validation for user signup form I am creating a website for submissions. I want the users to register only with "abc.def@mycompany.com". I want to avoid e-mail ids such as @gmail, @yahoo, @hotmail etc during registration.

True: email should be @mycompany

False: email with @gmail, @yahoo, @hotmail

What should I do to achieve the result?

Thanks in advance
Can be managed by strpos easily. Below code will be in validateForm function

 $email = 'abc.def@mycompany.com';
 if (valid_email_address($email)) {
  if (strpos($email, '@mycompany.com') !== FALSE) {
       // Set form error message
   }
 }