note 27769 deleted from function.getmxrr by cece
| From: | cece@php.net | Date: | Sat, 16 Aug 2003 16:11:48 +0000 |
| Subject: | note 27769 deleted from function.getmxrr by cece | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54411@lists.php.net to get a copy of this message | ||
Note Submitter: kenny at cobramail.com
----
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.";
}
?>