> I do not use any loop comand yet

Yes you do. You have a while() loop. 

> how come I have all email addresses from the data file in the TO: line
> but each email is send with unique information to the client,

Because that info is the result of one split() call, but you're building
up headers with continuous data each time you loop through the lines of
the file.
 
> only TO and From: line is filled with all the values from the data
file.
> What do I do ?
> I hope I explain my self good enough can you help me a bit with the
code ?

Just try as I suggested and use

$headers = "MIME-Version: 1.0\r\n";

as your first line of building headers.

---John Holmes...

> 
> <?php
> $fp = fopen ("data/default2.users", "r");
> while (!feof ($fp)) {
>     $buffer = fgets($fp, 4096);
>     list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email,
$Street,
> $City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2,
$ex3,
> $ex4, $ex53, $ex7 ) = split ("\|", $buffer);
> 
> $myname = "name text ";
> $myemail = "[EMAIL PROTECTED];
> $myreplyemail = "[EMAIL PROTECTED]";
> $contactname = "$Realf $RealL";
> $contactemail = "$Email";
> 
> $message = "Dear $Realf $RealL <br>  message text here ... use of
above
> arrays . ";
> 
> $subject = "Subject text here";
> 
> $headers .= "MIME-Version: 1.0\r\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> $headers .= "From: ".$myname." <".$myemail.">\r\n";
> $headers .= "To: ".$contactname." <".$contactemail.">\r\n";
> $headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
> $headers .= "X-Priority: 1\r\n";
> $headers .= "X-MSMail-Priority: High\r\n";
> $headers .= "X-Mailer: Server here";
> mail($contactemail, $subject, $message, $headers);
> echo "<font face=\"Arial\" size=\"1\" color=\"#000000\">  mail to
$Realf
> $RealL done ...</font><br>  ";
> }
> fclose ($fp);
> 
> ?>
> 
> 
> 
> 
> ----- Original Message -----
> From: John W. Holmes <[EMAIL PROTECTED]>
> To: 'WebDev' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Sunday, March 02, 2003 7:23 PM
> Subject: RE: [PHP] File array mailing Loop problem. Help needed
urgently
> 
> 
> > [snip]
> > > The script is working everything is send the way I wish, the only
> > problem
> > > is
> > > that the 200 user would see all 199 useres email addresses  before
him
> > ..
> > > and so on each member Member 800 sees 799 emails in the email as
well
> > 799
> > > times the from address big problem.
> > >
> > > I want to send each email in single loop ?  so that each client
gets
> > only
> > > one email address to see and my whole doing is not a security risk
> > [snip]
> > > $headers .= "MIME-Version: 1.0\r\n";
> > > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> > > $headers .= "From: ".$myname." <".$myemail.">\r\n";
> > > $headers .= "To: ".$contactname." <".$contactemail.">\r\n";
> > > $headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n";
> > > $headers .= "X-Priority: 1\r\n";
> > > $headers .= "X-MSMail-Priority: High\r\n";
> > > $headers .= "X-Mailer: Server Text here";
> > >
> > > mail($contactemail, $subject, $message, $headers);
> >
> > You're constantly building up $headers with each loop. You're first
line
> > should be
> >
> > $headers = "MIME-Version: 1.0\r\n";
> >
> > so that it starts from an empty string and adds the rest. Or, clear
> > $headers after you call mail(), so the next loop starts with an
empty
> > variable.
> >
> > ---John W. Holmes...
> >
> > PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
> > today. http://www.phparch.com/
> >




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to