Page 1 of 1

Help with sending email over proxy

Posted: Thu Mar 23, 2006 4:22 am
by black187
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hello

I'm trying to write a php script, which will send me email message through proxy that is setup on my work place (tel780:8080). 

I found many mail script, but I cannot send email because of proxy. I tried with Http tunneling programs, but no luck.

If somebody knows how to write this kind of script I would appreciate.

This code access the web pages through proxy, but I don't know how to setup for mail.

Code: Select all

<?php
/*************start code**************/
/*your proxy server address*/
$proxy = "tel780";
/*your proxy server port*/
$port = 8080;
/*the url you want to connect to*/
$url = "http://www.php.net/";
$fp = fsockopen($proxy, $port);
fputs($fp, "GET $url HTTP/1.0\r\nHost: $proxy\r\n\r\n");
while(!feof($fp)){
  $line = fgets($fp, 4000);
  print($line);
}
fclose($fp);
?>

feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Thu Mar 23, 2006 4:57 am
by timvw
email is transported with SMTP.. And uses port25..

Thus, before we can give you any feedback you should explain us how that proxy exactly works... But i think you're better of if you ask it to the people that administrate that proxy.

Posted: Thu Mar 23, 2006 5:10 am
by black187
Every port is closed, except port 80 (for html), which goes through http proxy.