title: PHP's fsockopen() function problem
body: <p>Hi there :)<br>
  I have a problem with a function of PHP. I can't understand why it cannot work, and that's a problem for my project.</p>
  
  <p>The context :<br>
  I have Joomla and want it to send email via the option "SMTP server". It's not working and the return is "Can't connect to smtp host".<br>
  I had searched in google for that problem and all the solutions I found didn't work for me. So I decided to go into the code to see what happened. The problem occurs when the code call to the method "fsockopen()", a built-in PHP method. This method say that the connection to the host timed out.<br>
  <strong>Where it becomes funny : I can connect and send email with this host, with exact same parameters with a mail client (Evolution), on the same machine (so it's not a problem of opened port or something else).</strong></p>
  
  <p><strong>The method is :</strong><br>
  <pre><code>fsockopen($host, $port, $errno, $errstr, $tval);  </pre></code></p>
  
  <p><strong>The used parameters and error returned :</strong><br>
  <pre><code>$host : ssl://smtp.laposte.net. 
  $port : 25
  $errno : 110
  $errstr : Connection timed out
  $tval : 10</pre></code></p>
  
  <p><strong>Some technical information :</strong><br>
  PHP Version : 5.2.14<br>
  Sockets Support : enabled<br>
  OS : Ubuntu 10.10 under a virtual machine (VMWare)<br>
  Port : port 25 (smtp) is open on the virtual machine AND on the host of the virtual machine.  </p>
  
  <p>If someone had an idea how this function work and why it cannot connect, it will help me A LOT,<br>
  Thanks in advance,<br>
  Damien</p>