title: How can I Setup XAMPP for SMTP outgoing Email on a UNIX machine
body: <p>I've created a PHP Mail class with the method of registerNewUser. Basically as my title says the method is returning true, when it should be returning false because i'm not receiving an email. Can someone explain if i'm doing something wrong? (Please do not comment on me sending the user an unencrypted password. This unencrypted password is a 25 character alpha numeric randomly generated password. Security is not an issue here) I do not wish to use some type of framework. I want to code this by hand, so please don't tell me to use PHPMailer or anything of that sort.</p>
  
  <p>Edit: I'm figuring out that I'm needing to set up XAMPP to send outgoing Emails using SMTP. This question is not a duplicate as every other answer on every other question is windows based, and even then doesn't provide a step by step instruction on how to set up SMTP on a XAMPP localhost server.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>&lt;?php
  class Mail {
  
    private $headers;
  
    public function __construct() {
      // Setting Up Mail Headers
      $this-&gt;headers  = "MIME-Version: 1.0 \r\n";
      $this-&gt;headers .= "Content-type: text/html; charset=iso-8859-1 \r\n";
      $this-&gt;headers .= "From: Admin @ NAStepsOnline &lt;no-reply@NAStepsOnline.com&gt;\r\n"."X-Mailer: php";
    }
  
    /**
    * @desc                   Mails the User from registration email.
    *                         This function should only be called through
    *                         registerNew() within the user.class file
    * @param  str $userName   First Name of the user
    * @param  str $userEmail  Email address of the user
    * @param  str $userPass   Password of user (UNENCRYPTED)
    * @return bool            True = Mail Sent Sucessfully
    *                         False = Mail Not Sent
    */
    public function registerNewUser($userName, $userEmail, $userPass) {
      // Define Subject Line
      $subject = "Thanks " . $userName . " for Registering On NAStepsOnline.com";
      // Setting Up Message to the User
      $msg = "&lt;html&gt;&lt;body&gt;";
      $msg .= $userName . " Thanks for registering at NAStepsOnline.com&lt;br&gt;&lt;br&gt;";
      $msg .= "Here is your password (case sensitive): " . $userPass . "&lt;br&gt;&lt;br&gt;";
      $msg .= "Please use the login form to login.&lt;br&gt;";
      $msg .= "To assign a sponsor to your account please visit the Profile Settings page and click on My Sponsor.&lt;br&gt;";
      $msg .= "If you have any problems please contact us using the Contact Us page.&lt;br&gt;&lt;br&gt;";
      $msg .= "Thanks,&lt;br&gt;The Team @ NAStepsOnline.com";
      $msg .= "&lt;/body&gt;&lt;/html&gt;";
  
      // Mailing the user Registration
      $mail = mail($userEmail, $subject, $msg, $this-&gt;headers);
      if($mail) {
        return true;
      } else {
        return false;
      }
    }
  }
  </code></pre>