title: Send email using xampp
body: <p>I tried a bunch of stuff but still i can't send email from my local host! </p>
  
  <p>My php.ini file looks like this: </p>
  
  <pre><code>[mail function]
  
  SMTP=smtp.gmail.com
  smtp_port=587
  sendmail_from = brothersrbin@gmail.com
  sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
  ;sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
  </code></pre>
  
  <p>and my senmail.ini file looks like: </p>
  
  <pre><code>smtp_server=smtp.gmail.com
  smtp_port=587
  error_logfile=error.log
  debug_logfile=debug.log
  auth_username=brothersrbin@gmail.com
  auth_password=my-gmail-password      //my real pass for this email
  force_sender=brothersrbin@gmail.com
  </code></pre>
  
  <p>And my php code looks like : </p>
  
  <pre><code>$to = "poznan.milan@gmail.com";
  $subject = "REsttujte vas password";
  $message = "This is simple text message.";
  $header = "From:brothersrbin@gmail.com \r\n";
  $retval = mail($to,$subject,$message,$header);
  if( $retval == true )  
  {
     echo "Message sent successfully...";
  }
  else
  {
     echo "Message could not be sent...";
  }
  </code></pre>
  
  <p>So can someone help me. What is wrong in here? And can You give to me another solution?</p>