how to check if a mail server exists or not?
<p>my PHP page currently doesnot have a mail server, instead of throwing an error, is it possible to catch this error and print it out to the user?</p>

<p>this is what I have so far, it just gives an error.</p>

<pre><code>&lt;?php 
$foo = mail('test@test.com', 'subject', 'message');
if ( $foo == false )
{
echo "no mail server";
}
?&gt;
</code></pre>

<p>thanks!</p>
