title: How can I get the error message for the mail() function?
body: <p>I've been using the PHP <code>mail()</code> function.</p>
  
  <p>If the mail doesn't send for any reason, I'd like to echo the error message. How would I do that?</p>
  
  <p>Something like </p>
  
  <pre><code>$this_mail = mail('example@example.com', 'My Subject', $message);
  
  if($this_mail) echo 'sent!';
  else echo error_message;
  </code></pre>
  
  <p>Thanks!</p>