note 27769 added to function.getmxrr
| From: | kenny at rack1 dot php dot net | Date: | Wed, 18 Dec 2002 11:40:07 +0000 |
| Subject: | note 27769 added to function.getmxrr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41054@lists.php.net to get a copy of this message | ||
here is a quick hack to check if a email domain is valid.
<?php
$email = explode('@',$email);
$mailhost = $email[1];
$mailhost=$mailhost.".";
if (getmxrr($mailhost, $mxhosts) == FALSE && gethostbyname($mailhost) == $mailhost){
echo "$mailhost is not a valid e-mail host.";
}else{
echo "$mailhost is a valid e-mail host.";
}
?>
--
http://www.php.net/manual/en/function.getmxrr.php
http://master.php.net/manage/user-notes.php?action=edit+27769
http://master.php.net/manage/user-notes.php?action=delete+27769
http://master.php.net/manage/user-notes.php?action=reject+27769