<?
//change this to your email.
$to = "[email protected]";
$from = "[email protected]";
$subject = "Forward test";
$host = "www.maxprog.com";
$uri = "/site/index_us.php";
$fp = fsockopen ( $host, 80, $errno, $errstr, 30 );
if (!$fp) {
Exit( "Connection error #$errno:$errstr" );
} else {
$out = "GET " . $uri . " HTTP/1.1\r\n";
$out .= "HOST: " . $host . "\r\n";
$out .= "Content-type: text/html\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite( $fp, $out );
while (!feof($fp)) {
$in .= fgets ( $fp, 128 );
}
fclose ($fp);
}
$contents = Explode( "\r\n\r\n", $in );
$message = $contents[1];
$message = str_replace( '</head>', '<base href="http://' . $host . '/"></head>', $message );
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
//options to send to cc+bcc
//$headers .= "Cc: [email][email protected][/email]";
//$headers .= "Bcc: [email][email protected][/email]";
// now lets send the email.
mail( $to, $subject, $message, $headers );
echo "Message has been sent....!";
?>