title: sending mail using XAMPP, sendmail, and gmail smtp server
body: <p>This seems like something fairly straightforward and my php script is able to execute. However I am never receiving the mail.  Here is the relevant code:</p>
  
  <p><strong>php.ini</strong></p>
  
  <pre><code>[mail function]
  ; For Win32 only.
  ; http://php.net/smtp
  ;SMTP = localhost
  ; http://php.net/smtp-port
  ;smtp_port = 25
  
  sendmail_path = "C:\xampplite\sendmail\sendmail.exe -t -i"
  </code></pre>
  
  <p><strong>sendmail.ini</strong></p>
  
  <pre><code>smtp_server=smtp.gmail.com
  
  smtp_port=587
  smtp_ssl=auto
  default_domain=mydomain.com
  error_logfile=error.log
  debug_logfile=debug.log
  auth_username=username50@gmail.com
  auth_password=passpass
  
  force_sender=myemail@gmail.com
  hostname=smtp.gmail.com
  </code></pre>
  
  <p>Is there anything here I'm missing? My script is sending email to myself. That wouldn't be a problem right?</p>
  
  <pre><code>&lt;?php
  $to = "blah@gmail.com";
  $subject = "Test mail";
  $message = "Hello! This is a simple email message.";
  $from = "someonelse@example.com";
  $headers = "From:" . $from;
  mail($to,$subject,$message,$headers);
  echo "Mail Sent.";
  ?&gt;
  </code></pre>