Jump to content

fsockopen


Stewart

Recommended Posts

trying to configure phpbb's smtp.php to sent email via a proxy. this file uses the fsockopen command to connect directly to teh smtp server, however i need to connect via proxy instead. does anyone have any idea how i can do this?

Link to comment
Share on other sites

have tried some clever use of grey matter instead and came up with a thought - if an smtp stream couldnt get through the proxy then why not send an http stream through and have a php script somewhere on teh other side to translate it into mail - i.e. if i send an html request through this proxy server with teh required data to a php script on an external server with access to mailing fucntions then it could send it insteadunfortuanately this presents a problem ofhaving to send post data behind the scenes.i have with success managed to use the fsockopen command to connect to theis external server via the proxy and send a GET request through to an external scriptbasically sending the following comand out:

GET http://www.google.com/search?q=pizza HTTP/1.1

unfortunately because of the size of these emails it cant be sent using GET, needs to use post, but i cant get post to work this way - does anyone know how to write th browser headers for a form post?

Link to comment
Share on other sites

Well, it looks like post is not a header at all, but is a part of the body of the request.From http://developers.sun.com/techtopics/mobil...ttips/HTTPPost/

In constrast, a POST request sends additional data to the web server, specified after the URL, the headers, and a blank line to indicate the end of the headers. An example:
POST /login.jsp HTTP/1.1Host: www.mysite.comUser-Agent: Mozilla/4.0Content-Length: 27Content-Type: application/x-www-form-urlencodeduserid=joe&password=guessme

Make sure you set content-length correctly.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...