Adam Chetnik
Adam Chetnik

Reputation: 2026

php fsockopen connection

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?

Upvotes: 0

Views: 428

Answers (2)

Gordon
Gordon

Reputation: 317177

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?

Upvotes: 2

Amber
Amber

Reputation: 527248

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.

Upvotes: 3

Related Questions