title: Catching PHP mail() errors and showing reasonable user error message
body: <p>I'm writing a fairly simple register php script that uses PHP's built in <code>mail()</code> function to email the user an activation link.</p>
  
  <p>The problem is that I can catch the normal errors such as email formatting but once it fires off to the server and say a user has put in an email address that fails, I don't know how to catch this error and tell the user whats happened.</p>
  
  <p>For example at the moment I get this:</p>
  
  <blockquote>
    <p>Warning: mail() [function.mail]: SMTP server response: 554
    : Recipient address rejected: Relay access
    denied in <strong>**</strong> on line 70</p>
  </blockquote>
  
  <p>Any ideas what I could do about errors like this? I'm aware of using the @ symbol to suppress the error but I kinda of want to do more than that and handle the issue.</p>