note 59538 added to ref.mail
| From: | tinus at osu1 dot php dot net | Date: | Fri, 09 Dec 2005 09:50:01 +0000 |
| Subject: | note 59538 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-99805@lists.php.net to get a copy of this message | ||
as to fred's posting, I had to change the code a bit:
-add a hashbang
-add "-t -i " to the sendmail call
great idea though.
#!/usr/bin/php
<?php
$tmpfile = "/tmp/" . uniqid('') . ".mail";
$fp = fopen($tmpfile,"w");
fwrite($fp,"x-wls-cc-filter: On\n");
while($line = fgets(STDIN))
{
$line = ereg_replace("^bcc:","x-wlsspam-bcc:",$line);
$line = ereg_replace("^cc:","x-wlsspam-cc:",$line);
fwrite($fp,$line);
}
fclose($fp);
$cmd = '/usr/sbin/sendmail -t -i ';
for($i = 1 ; $i < $argc; $i++)
{
$cmd .= $argv[$i];
$cmd .= ' ';
}
$cmd .= "<$tmpfile";
system($cmd);
?>
----
Manual Page -- http://www.php.net/manual/en/ref.mail.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+59538
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59538&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59538&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59538&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59538&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59538&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59538&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59538&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+59538&report=yes
Search -- http://master.php.net/manage/user-notes.php