E-mail validation form api What is the best way to handle server side e-mail validation in the form API?
Can it be implemented somewhere inside part of the form described below or are there other options?

 $form['address']['mail'] = array(
   '#type' =&gt; 'textfield',
   '#title' =&gt; t('E-mail'),
   '#required' =&gt; TRUE,
   '#default_value' =&gt; $subscription-&gt;mail,
   '#maxlength' =&gt; 255,
 ); 

 $form['submit'] = array(
   '#type' =&gt; 'submit',
   '#value' =&gt; t('Versturen'),
 );

 return $form;
}
Create a validation function for your form.  Here is an example using your form. For instance, say your form code is in a function called my_email:

&lt;?php
function my_email() {
  $form = array();

  $form['address']['mail'] = array(
   '#type' =&gt; 'textfield',
   '#title' =&gt; t('E-mail'),
   '#required' =&gt; TRUE,
   '#default_value' =&gt; $subscription-&gt;mail,
   '#maxlength' =&gt; 255,
  ); 

  $form['submit'] = array(
   '#type' =&gt; 'submit',
   '#value' =&gt; t('Versturen'),
  );

  return $form;
}

function my_email_validate($form, &amp;$form_state) {
  // YOUR CUSTOM VALIDATION CODE GOES HERE
 if (!valid_email_address($mail)) {
   form_set_error('submitted][email_address', t('The email address appears to be invalid.'));
   }
}

function my_email_submit($form, &amp;$form_state) {
  // YOUR CUSTOM SUBMIT CODE GOES HERE
}
?&gt;


This function will allow you to write custom code to determine if the values entered in your fields are valid or not.  You can also add a custom submit function for your form to execute custom code while the form is being submitted.  

Read more about validating forms at Validating Forms, submitting forms at Submitting Forms or read the whole article for a better understanding of the Forms API: Form API Quickstart Guide