tags:

views:

106

answers:

2

Hey

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?

+3  A: 

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.

Amber
+2  A: 

I second Dav's answer, but also am curious as to whether there is any specific reason why you are using sockets to do that instead of resorting to readily available packages that can do HTTP requests and/or mail retrieval and sending?

Gordon
+1, although port 25 is SMTP -- which would probably be mail sending, rather than mail retrieval ;) http://framework.zend.com/manual/en/zend.mail.sending.html
Frank Farmer
My fault. Of course you are right. Thanks for pointing it out.
Gordon