Php fsockopen connection

connectionphp

I'm using php and fsockopen to connect to port 80 on another server to read content from a website.

I'd like to use the same function to access port 25 to read the mail servers header. Port 25 us being used by my mail server on my server.

Is it possible to connect to port 25 on the other server from port say 99 on my server (Or another free port

Any ideas?

Best Solution

Typically opening a connection to a given port on a remote server does not require that the same port be free on your server - source ports for arbitrary TCP requests are typically assigned randomly.