Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Send mail via cron job with an overly-protective ISP' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Send mail via cron job with an overly-protective ISP
Authored by: ossiejnr on Mar 12, '07 11:48:29AM

I had problems with send mail via the "mail" command and found a very useful PHP script which does the same thing but sets the reply address. I copied this off another website, but can't remember where, so credit to the author.

#!/usr/bin/php
<?php
$to = $argv[1];
$subject = $argv[2];
$msg = "";
while (!feof(STDIN)) {
$msg .= fgets(STDIN);
}
$header = "From: insert from address here\r\n";
mail($to,$subject,$msg,$header);
?>



[ Reply to This | # ]