title: PHP xampp mail() function not working
body: <p>I am trying to send emails from my gmail account using php (xampp).
  I search over stackoverflow and as I got the things I changed my xampp's files sendmail.ini and php.ini as,</p>
  
  <p>In C:\xampp\php\php.ini I removed the semicolon from the beginning of the line <code>extension=php_openssl.dll</code> to make SSL working for gmail for localhost.</p>
  
  <p>in php.ini file under [mail function] I changed</p>
  
  <pre><code>SMTP=smtp.gmail.com
  smtp_port=25
  sendmail_from = mukul.agrawal19@gmail.com
  sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
  </code></pre>
  
  <p>Then in C:\xampp\sendmail\sendmail.ini. I replaced all the existing code in sendmail.ini with following code</p>
  
  <pre><code>[sendmail]
  
  smtp_server=smtp.gmail.com
  smtp_port=25
  error_logfile=error.log
  debug_logfile=debug.log
  auth_username=mukul.agrawal19@gmail.com
  auth_password=my-gmail-password
  force_sender=mukul.agrawal19@gmail.com
  </code></pre>
  
  <p>then I wrote a simple mail function</p>
  
  <pre><code>&lt;?php
  $to = 'mukulagrawal13@live.com';
  $subject = 'Test email'; 
  $message = "Hello World!\n\nThis is my first mail."; 
  $headers = "From: mukul.agrawal19@gmail.com\r\nReply-To: mukul.agrawal19@gmail.com";
  $mail_sent = @mail( $to, $subject, $message, $headers );
  echo $mail_sent ? "Mail sent" : "Mail failed";
  ?&gt;
  </code></pre>
  
  <p>then went on the this page by my browser,
  got echo as Mail Failed.</p>
  
  <p>I saw my debug file and I got</p>
  
  <pre><code>14/12/03 18:24:00 ** --- MESSAGE BEGIN ---
  14/12/03 18:24:00 ** To: mukulagrawal13@live.com
  14/12/03 18:24:00 ** Subject: Test email
  14/12/03 18:24:00 ** From:mukul.agrawal19@gmail.com
  14/12/03 18:24:00 ** Reply-To:mukul.agrawal19@gmail.com
  14/12/03 18:24:00 ** 
  14/12/03 18:24:00 ** Hello World!
  14/12/03 18:24:00 ** 
  14/12/03 18:24:00 ** This is my first mail.
  14/12/03 18:24:00 ** --- MESSAGE END ---
  14/12/03 18:24:01 ** Connecting to smtp.gmail.com:25
  14/12/03 18:24:08 ** Connected.
  14/12/03 18:24:08 &lt;&lt; 220 mx.google.com ESMTP o17sm23150442pdn.33 - gsmtp&lt;EOL&gt;
  14/12/03 18:24:08 &gt;&gt; EHLO Mukul-PC&lt;EOL&gt;
  14/12/03 18:24:10 &lt;&lt; 250-mx.google.com at your service, [223.186.182.29]&lt;EOL&gt;250-SIZE 35882577&lt;EOL&gt;250-8BITMIME&lt;EOL&gt;250-STARTTLS&lt;EOL&gt;250-ENHANCEDSTATUSCODES&lt;EOL&gt;250-PIPELINING&lt;EOL&gt;250-CHUNKING&lt;EOL&gt;250 SMTPUTF8&lt;EOL&gt;
  14/12/03 18:24:10 ** Authenticating as mukul.agrawal19@gmail.com
  14/12/03 18:24:10 &gt;&gt; STARTTLS&lt;EOL&gt;
  14/12/03 18:24:12 &lt;&lt; 220 2.0.0 Ready to start TLS&lt;EOL&gt;
  14/12/03 18:24:14 &gt;&gt; QUIT&lt;EOL&gt;
  
  lots of codes in unknown language.
  
  14/12/03 18:21:47 ** Disconnected.
  14/12/03 18:21:47 ** Disconnecting from smtp.gmail.com:25
  14/12/03 18:21:47 ** Disconnected.
  14/12/03 18:21:47 ** Disconnected.
  14/12/03 18:21:47 ** Connection Closed Gracefully.
  </code></pre>
  
  <p>I am not getting whats the problem.</p>