title: PHP mail() using Sendmail on Mac OS X Leopard (10.5.8)
body: <p>I've been struggling to get a really basic PHP function working on my iMac, the PHP <code>mail()</code> function.</p>
  
  <p>I've used it countless times, albeit on a Windows platform and now I'm trying to get it running on Mac.</p>
  
  <p>I've installed XAMPP v1.01 maybe because I didn't know any better at the time and I thought it would all just work fine, because that's what it's supposed to do. (Or so I thought).</p>
  
  <p>I've tried the following pages of instructions to no avail: </p>
  
  <ul>
  <li><a href="http://blog.rajatpandit.com/2009/03/15/php-mail-and-osx-leopard/" rel="noreferrer">http://blog.rajatpandit.com/2009/03/15/php-mail-and-osx-leopard/</a></li>
  <li><a href="http://theandystratton.com/2009/fix-phps-mail-function-after-latest-os-x-leopard-update" rel="noreferrer">http://theandystratton.com/2009/fix-phps-mail-function-after-latest-os-x-leopard-update</a></li>
  <li><a href="http://forums.oreilly.com/index.php?showtopic=5243&amp;mode=threaded&amp;pid=14721" rel="noreferrer">http://forums.oreilly.com/index.php?showtopic=5243&amp;mode=threaded&amp;pid=14721</a></li>
  <li><a href="http://jspr.tndy.me/2008/05/php-mail-and-osx-leopard/" rel="noreferrer">http://jspr.tndy.me/2008/05/php-mail-and-osx-leopard/</a></li>
  </ul>
  
  <p>To start with I did not have an entry for:
  <code>MAILSERVER=-YES-</code> in my <strong>/etc/hostconfig</strong> so I created it.</p>
  
  <p>I added the full path to sendmail in my <strong>php.ini</strong>: <code>sendmail_path = "/usr/sbin/sendmail -t -i"</code></p>
  
  <p>I understand I don't need to set a <code>myhostname</code> variable in <strong>/etc/postfix/main.cf</strong> because I'm only planning on sending mail not receiving it. (NB. I've also tried it with this setting enabled!)</p>
  
  <p>I've start postfix and then tried running the script but the script just processes with no error message, it just basically constantly looks as if it's working but nothing happens (I've triple checked the code for script).</p>
  
  <p>I noticed some peoples solutions do not even mention having to start the postfix daemon for them to get the PHP <code>mail()</code> function to work.</p>
  
  <p>Any ideas or things for me to try?</p>
  
  <p>If you need more info, please ask.</p>
  
  <p>P.</p>