I am trying to send multiple indivdual
emails to all the email addresses in
a text file I pass to a PHP script.
My problem is the e-mails get sent,
but the only one with a subject line
and a from line is the last one.
The rest have webuser in the from line
and nothing in the subject line.
The Subject and From data is in the body
of the body of the e-mail as follows:
"Subject: Breakthrough video technology lets you ride Moab and Paris-Roubaix, indoors!
From: tnt@altacam.com"
Then the rest of the body is just
as expected.
The code I am using is:
<?
/ this script will handle the list of email address passed in filename /
$userlist=file($filename);
$arrsize=count($userlist);
PRINT("<br>arrsize is $arrsize");
$loopindex=0;
while($loopindex<$arrsize)
{
$email=$userlist[$loopindex];
if ($email!="")
{
PRINT("<br>Sending email to $email");
/ Send relevant emails /
mail("$email", " Breakthrough video technology lets you ride Moab and Paris-Roubaix, indoors!",
"It's cold and snowy outside and you're stuck riding your trainer indoors...etc.
The T&T Team", "From: tnt@altacam.com");
}
loopindex++;
}
Help--this has been driving me crazy
most of the day!