Codice PHP:
$email_name = htmlspecialchars(trim(str_replace(' ', '', $_POST['email_name'])));
$email_domain = htmlspecialchars(trim(str_replace(' ', '', $_POST['email_domain'])));
$email_extension = htmlspecialchars(trim(str_replace(' ', '', $_POST['email_extension'])));
$email = $email_name . '@' . $email_domain . '.' . $email_extension;
$extensions = array('.prova', '.prova_2');
$ename = '[-a-z0-9!#$%&\'*+/=?^_`{|}~]';
$edomain = '([a-z]([-a-z0-9]*[a-z0-9]+)?)';
$eextension = '([a-z])';
$regex = '^' . $ename . '+' .
'(\.' . $ename . '+)*'.
'@'.
'(' . $edomain . '{1,63})+'.
'.'.
$eextension . '{2,3}'.
'$';
if((!eregi($regex, $email)) || (!in_array($email_extension, $extensions)))
{
print 'ERROR';
}
else
{
print 'OK!';
}
Risolto con questo script, grazie ancora