title: PHP mailer smtp setup with gmail
body: <p>Hello guys I have stuck with this problem for a while now. I am trying to send mail from xampp. I have went through several solutions posted here but none of them seem to work still. kind of need someone to point me to the right direction.</p>
  
  <p>so in my <strong>php.ini</strong> </p>
  
  <pre><code>[mail function]
  SMTP=smtp.gmail.com
  smtp_port=587
  sendmail_from = user@gmail.com
  sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
  </code></pre>
  
  <p>I also have the <strong>sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"</strong> commented with a <strong>;</strong></p>
  
  <p>now in my <strong>sendmail.ini</strong></p>
  
  <pre><code>[sendmail]
  
  smtp_server=smtp.gmail.com
  smtp_port=587
  error_logfile=error.log
  debug_logfile=debug.log
  auth_username=user@gmail.com
  auth_password=123456
  force_sender=shadidhaque2014@gmail.com
  </code></pre>
  
  <p>P.s: I only have the above code in sendmail.ini
  now for the php script I have something very simple:</p>
  
  <pre><code>$send=mail('rzs2009@yahoo.com', 'subject', 'blah blah blah');
                      if ($send) {
                          # code..
                          echo "yes";
                      }else
                      {
                          echo "no";
                      }
  </code></pre>
  
  <p>now everytime I try to run the program I get a no. So no email is being sent. Where might I be going wrong. 
  Thanks in advance.</p>