note 23878 added to function.getmxrr
| From: | mad-generic at NOSPAMnetilium dot org | Date: | Tue, 30 Jul 2002 20:33:15 +0000 |
| Subject: | note 23878 added to function.getmxrr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34015@lists.php.net to get a copy of this message | ||
If this function is going to be used for e-mail validation purposes; Please bear in mind that MX
records are not mandatory and that RFC974 clearly states: If no MX records exist for a given host,
MTAs should interpret this as if there is one MX RR matching the host itself. (I.e. you should call
gethostbyname() to see if the host has an A record.)
<?php
$host=$host.".";
if ( getmxrr( $host, $mxhosts ) == FALSE &&
gethostbyname( $host ) == $host ) {
echo "$host is not a valid e-mail host.";
} else {
echo "$host 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+23878
http://master.php.net/manage/user-notes.php?action=delete+23878
http://master.php.net/manage/user-notes.php?action=reject+23878