PDA

View Full Version : Automatically mail the page.



sunny
07-20-2005, 08:54 AM
well,
I want a html page, on the net, to be automatically mailed to me.Does any one knows where i can find this kind of script.And whether this is possible with the help of cgi script or php script.

simonf
07-25-2005, 02:36 PM
Hi

When do you want it mail....
1)when they fill in some info on the page and hit submit or
2) when they just visit the page??? which would be strange as you could get K's and K's of mail..... if 1) look at http://www.smos.co.za/knite.php it might help you.. it even sends them an email as well.... (does not work on this site as coded for another) but you will get the idea....

Twey
07-25-2005, 03:55 PM
With PHP, yes you can.


$page = <<<END
Put page here, no escaping or anything fancy necessary.
END;

mail($to, $subject, $page, "Content-Type: text/html\r\n");


Or, if it's an existing page...


$file = '/home/user/file.htm'; // Can also be an url: http://www.site.com/page.php.

ob_start();
include($file);
$page = ob_get_contents();
ob_end_clean();
$buffer = fgets($handle, 4096);

mail($to, $subject, $page, "Content-Type: text/html\r\n");