<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Get MX records corresponding to a given Internet host name</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.gethostname.html">gethostname</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.getprotobyname.html">getprotobyname</a></div> <div class="up"><a href="ref.network.html">Network Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.getmxrr" class="refentry"> <div class="refnamediv"> <h1 class="refname">getmxrr</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">getmxrr</span> — <span class="dc-title">Get MX records corresponding to a given Internet host name</span></p> </div> <div class="refsect1 description" id="refsect1-function.getmxrr-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><strong>getmxrr</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$hostname</code></span> , <span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$mxhosts</code></span> [, <span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$weight</code></span> ] )</div> <p class="para rdfs-comment"> Searches DNS for MX records corresponding to <em><code class="parameter">hostname</code></em>. </p> </div> <div class="refsect1 parameters" id="refsect1-function.getmxrr-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">hostname</code></em></span> <dd> <p class="para"> The Internet host name. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">mxhosts</code></em></span> <dd> <p class="para"> A list of the MX records found is placed into the array <em><code class="parameter">mxhosts</code></em>. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">weight</code></em></span> <dd> <p class="para"> If the <em><code class="parameter">weight</code></em> array is given, it will be filled with the weight information gathered. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.getmxrr-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> if any records are found; returns <strong><code>FALSE</code></strong> if no records were found or if an error occurred. </p> </div> <div class="refsect1 changelog" id="refsect1-function.getmxrr-changelog"> <h3 class="title">Changelog</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Description</th> </tr> </thead> <tbody class="tbody"> <tr> <td>5.3.0</td> <td> This function is now available on Windows platforms. </td> </tr> </tbody> </table> </p> </div> <div class="refsect1 notes" id="refsect1-function.getmxrr-notes"> <h3 class="title">Notes</h3> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> This function should not be used for the purposes of address verification. Only the mailexchangers found in DNS are returned, however, according to <a href="http://www.faqs.org/rfcs/rfc2821" class="link external">» RFC 2821</a> when no mail exchangers are listed, <em><code class="parameter">hostname</code></em> itself should be used as the only mail exchanger with a priority of <em>0</em>. </p> </p></blockquote> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> For compatibility with Windows before this was implemented, then try the <a href="http://pear.php.net/" class="link external">» PEAR</a> class <a href="http://pear.php.net/package/Net_DNS" class="link external">» Net_DNS</a>. </p> </p></blockquote> </div> <div class="refsect1 seealso" id="refsect1-function.getmxrr-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.checkdnsrr.html" class="function" rel="rdfs-seeAlso">checkdnsrr()</a> - Check DNS records corresponding to a given Internet host name or IP address</span></li> <li class="member"> <span class="function"><a href="function.dns-get-record.html" class="function" rel="rdfs-seeAlso">dns_get_record()</a> - Fetch DNS Resource Records associated with a hostname</span></li> <li class="member"> <span class="function"><a href="function.gethostbyname.html" class="function" rel="rdfs-seeAlso">gethostbyname()</a> - Get the IPv4 address corresponding to a given Internet host name</span></li> <li class="member"> <span class="function"><a href="function.gethostbynamel.html" class="function" rel="rdfs-seeAlso">gethostbynamel()</a> - Get a list of IPv4 addresses corresponding to a given Internet host name</span></li> <li class="member"> <span class="function"><a href="function.gethostbyaddr.html" class="function" rel="rdfs-seeAlso">gethostbyaddr()</a> - Get the Internet host name corresponding to a given IP address</span></li> <li class="member">the <em>named(8)</em> manual page</li> </ul> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.gethostname.html">gethostname</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.getprotobyname.html">getprotobyname</a></div> <div class="up"><a href="ref.network.html">Network Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>