Re: Re: [PHP3] Re: [PHP-DEV] Re: [PHP3] Re: [PHP-DEV] Re: [PHP3] CheckDNSRR failing on a valid domain
| From: | Sascha Schumann | Date: | Wed, 25 Aug 1999 13:07:51 +0000 |
| Subject: | Re: Re: [PHP3] Re: [PHP-DEV] Re: [PHP3] Re: [PHP-DEV] Re: [PHP3] CheckDNSRR failing on a valid domain | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-10170@lists.php.net to get a copy of this message | ||
> What I want is to get the MX records e-na.net or any other domain. It
> seems I can't get the CNAME record as well. If getting the A record would
> get me there it would help but it doesn't seem to be it.
I answered a single question. Now, let's put that in context.
The following code should demonstrate what you need to do to get
a useable array of mail exchangers for a specific host.
function get_mx_hosts($host) {
$mx_hosts = array();
if(!getmxrr($host, &$mx_hosts))
$mx_hosts[] = $host;
return $mx_hosts;
}
$hosts = get_mx_hosts($host);
for($i = 0; $i < count($hosts); $i++) {
$fp = fsockopen($hosts[i], 25);
fputs($fp, "HELO ...");
}
--
Regards,
Sascha Schumann
Consultant