title: Sending an email verification after registering
body: <p>I want, that users who register on my site, have to activate their account first, before using it. The problem is, that I don't get any email to my email test account.</p>
  
  <p>Before I start posting a code, could the problem be, that I'm working currently on a local machine with xampp? </p>
  
  <p>Otherwise, here is the code snippet</p>
  
  <pre><code>$random = substr(number_format(time() * rand(),0,'',''),0,10);
      $insertMailVerify = $this-&gt;db-&gt;prepare("INSERT INTO mailverify (mailAddress, token, datetime) VALUES (:mailAddress, :token, :date)");
      $insertMailVerify-&gt;execute(array(':mailAddress'=&gt;$emailAddress,
                                       ':token'=&gt;$random,
                                       ':date'=&gt;$date));
  
      $to = $emailAddress;
      $subject = "Activating your Account";
      $body = "Hi, in order to activate your account please visit http://localhost/FinalYear/activation.php?email=".$emailAddress." and fill in the verification code $random";
      if(mail($to, $subject, $body))
      {
          echo ("&lt;p&gt;Message success&lt;/p&gt;");
      }
      else {
          echo ("&lt;p&gt;Message fail&lt;/p&gt;");
      }
  </code></pre>
  
  <p>Just in case you wonder where i take $emailAddress from: This is just a code snippet, i already let the software echo the email address, and it's correct. It even goes in the "Message success" if case, but I still can't get any email. What could be the problem?</p>