title: Sendmail Wamp Php
body: <p>I have spent all the morning searching this on internet trying to find a solution about this.
  I have installed wamp server on Windows 8.1 and i'm trying to send some mails with sendmail (<a href="http://glob.com.au/sendmail/" rel="noreferrer">http://glob.com.au/sendmail/</a>) and my gmail account</p>
  
  <p>When i configure sendmail to use port nº 465 I always get this error:  Socket Error # 10060Connection timed out</p>
  
  <p>If i try to use port nº 587 i get this line on error log: Connection Closed Gracefully. But no  email is sent.</p>
  
  <p>This is my sendmail.ini file</p>
  
  <pre><code>[sendmail]
  smtp_server=smtp.gmail.com
  ;I tried both: 587, 465
  smtp_port=587
  ; I tried: "blank, auto ssl, tls, none"
  smtp_ssl=
  error_logfile=error.log
  debug_logfile=debug.log
  auth_username=myaccoun@gmail.com
  auth_password=mypass
  hostname=localhost
  </code></pre>
  
  <p>And this is php.ini file</p>
  
  <pre><code>[mail function]
  smtp_port = 465
  sendmail_path="C:\wamp\sendmail\sendmail.exe -t"
  mail.add_x_header = On
  </code></pre>
  
  <p>ssl_module is active on apache, and php uses php_open_ssl and php_socket extension.</p>
  
  <p>Also i tried to use stunnel whitout any success</p>
  
  <p>EDIT 27/01/2014</p>
  
  <p>I set smtp_port = 465 and smtp_ssl=ssl on sendmail.ini. Also, I set that sendmail.exe has to run as a Windows XP SP3 programs. After doing that, when I run sendmail.exe on windows console, it sends the email correctly. However, when wamp tries to send mails i get this error on sendmail's error logs.: Socket Error # 10060Connection timed out.</p>
  
  <p>This is the code I'm using to test sendmail:</p>
  
  <pre><code>&lt;?php
  $email = "mymail@gmail.com";
  $to = "mymail@gmail.com";
  $subject = "Hi!";
  $body = "Hi,How are you?";
  $headers = 'From: ' .$email . "\r\n".'Reply-To: ' . $email. "\r\n".'X-Mailer: PHP/' . phpversion();
  if (mail($to, $subject, $body, $headers)) echo("&lt;p&gt;Email successfully sent&lt;/p&gt;");
  else echo("&lt;p&gt;Email delivery failed&lt;/p&gt;");
  ?&gt;
  </code></pre>