Mail headers...
| From: | Richard Feather | Date: | Wed, 02 Feb 2000 05:18:52 +0000 |
| Subject: | Mail headers... | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-9654@lists.php.net to get a copy of this message | ||
A friend of mine opened a new bookstore and asked me to send a mailing to his customers (about 4,000). When I tried individual tests, I could use the mail function to make it look like it was my friend's email address in the headers. However, when I tried sending out to the mailing, the header and subject was stripped. Any ideas?
Here's the code:
<?
set_time_limit(0);
print "<h3>Test Address</h3>\n";
// open tblMembers.txt
if(!($testFile = fopen("tblMembers.txt","r")))
{
print "Error Will Robinson.\n";
exit;
}
$mailBody = "This is the body.";
$mailSubject = "New Bookstore";
$mailHeaders = "From: joe@bookstore.com";
$i=1;
while(!feof($testFile))
{
// read a line from the file
$testLine = fgetss($testFile, 255);
$testLineArray = explode(",", $testLine);
$email = $testLineArray[3];
print "Email: $email<br>\n";
$mailTo = $email;
if($mailTo!="")
{
mail($mailTo, $mailSubject, $mailBody, $mailHeaders);
}
// for reporting in case app fails...
if($outfile = fopen("/storage/outfile.txt","a"))
{
fputs($outfile, $email.":".$i."\n");
fclose($outfile);
}
$i++;
}
// close the file
fclose($testFile);
?>
Thanks...
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com