Jump to content

fsockopen() function problem


Douldoul

Recommended Posts

Hi there :)

I have a problem with a function of PHP. I can't understand why it cannot work, and that a problem for my project :facewall:.

 

The context :

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". 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.

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 approaching, I think).

The method is :

fsockopen($host, $port, $errno, $errstr, $tval);

The used parameters and error returned :

$host : ssl://smtp.laposte.net. 
$port :25. 
$errno :110. 
$errstr :Connection timed out. 
$tval :10

 

Some technical information :

PHP Version : 5.2.14

Sockets Support : enabled

OpenSSL : enabled

OS : Ubuntu 10.10 under a virtual machine (VMWare)

Port : port 25 (smtp) is open on the virtual machine AND on the host of the virtual machine

 

If someone had an idea how this function work and why it cannot connect, it will help me A LOT :birthday: ,

Thanks in advance,

Douldoul

 

Ps : maybe I'm not posting into the correct section :confused:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.