Using hook_form_alter() to prevent free email addresses from registering on a Drupal 6 site
A very simple example would be:

function example_mail_form_user_register_alter(&amp;$form,&amp;$form_state) {
  $form['mail']['#element_validate'] = array('example_mail_validate');
}

function example_mail_validate($element, &amp;$form_state) {
   //block gmail addresses
   if (stripos($form_state['values']['mail'], 'gmail.com') &gt; 0) {
     form_set_error('mail', t('Free email is not allowed.'));
   }
}


However you should lookout for more advanced solutions:


Simple email verification: email verify
http:BL 


  http:BL can prevent email address harvesters and comment spammers from
  visiting your site by using a centralized DNS blacklist.
  Mollom which also prevent spam on all your content/comments forms.