title: Can't send mail from localhost/xampp
body: <p>Failed to connect to mailserver at "mail.google.com" port 587, verify your "SMTP" and "smtp_port" setting in <strong>php.ini</strong> or use <code>ini_set()</code></p>
  
  <p>I configured my xampp php.ini and sendmail.ini file to use my Gmail account for sending email from my PHP script. i am using xampp. after changing the [mail function] part of my php.ini looks like this (i have deleted commented outlines for simplicity)</p>
  
  <pre><code>[mail function]
  SMTP = mail.google.com
  smtp_port = 587
  mail.add_x_header = Off
  </code></pre>
  
  <p>and my sendmail.ini file looks like this</p>
  
  <pre><code>[sendmail]
  smtp_server=mail.google.com
  smtp_port=587
  smtp_ssl=auto
  error_logfile=error.log
  auth_username=babar+gmail.com
  auth_password=**********
  </code></pre>
  
  <p>So what have I missed? Why am I getting this error?</p>