title: How to setup an SMTP server on Mac OS X?
body: <p>I work with PHP and I have <a href="http://www.mamp.info/en/index.html" rel="noreferrer">mamp</a> on my machine. I would like to send emails within my PHP code:</p>
  
  <pre><code>&lt;?php
   $to = "recipient@example.com";
   $subject = "Hi!";
   $body = "Hi,\n\nHow are you?";
   if (mail($to, $subject, $body)) {
     echo("&lt;p&gt;Message successfully sent!&lt;/p&gt;");
    } else {
     echo("&lt;p&gt;Message delivery failed...&lt;/p&gt;");
    }
   ?&gt;
  </code></pre>
  
  <p><strong>How can I configure a mail server for free on my mac machine ?</strong> </p>