Re: [PHP] File array mailing list pharse error

2003-03-03 Thread WebDev
Hello again
I worked on it so long now I have to come back to you
it gives me an Parse error:
Parse error: parse error, expecting `'('' in  members_read_send.php on line
5

Iam so sorry to bug u so much but can u help me finish here please?

?php
$lines = file(data/default2.users);
for each ($lines as $line)
{
list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email, $Street,
$City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2, $ex3,
$ex4, $ex53, $ex7 ) = explode(|, $buffer);

$myname = browseabit;
$myemail = [EMAIL PROTECTED];
$myreplyemail = [EMAIL PROTECTED];
$contactname = $Realf;
$contactemail = $Email;

$message =  message here ;
$subject = Subject 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: browseabit;

mail($contactemail, $subject, $message, $headers);

echo font face=\Arial\ size=\2\ color=\#00\Memmber  $Realf
$RealL from $City $State $Country is been notified.../fontbr  ;
}

?






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



Re: [PHP] File array mailing list pharse error

2003-03-03 Thread 1LT John W. Holmes
 I worked on it so long now I have to come back to you
 it gives me an Parse error:
 Parse error: parse error, expecting `'('' in  members_read_send.php on
line
 5

 Iam so sorry to bug u so much but can u help me finish here please?

 ?php
 $lines = file(data/default2.users);
 for each ($lines as $line)

foreach() is all one word...

 {
 list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email, $Street,
 $City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2, $ex3,
 $ex4, $ex53, $ex7 ) = explode(|, $buffer);

 $myname = browseabit;
 $myemail = [EMAIL PROTECTED];
 $myreplyemail = [EMAIL PROTECTED];
 $contactname = $Realf;
 $contactemail = $Email;

 $message =  message here ;
 $subject = Subject here;
 $headers .= MIME-Version: 1.0\r\n;

and change this to

$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: browseabit;

 mail($contactemail, $subject, $message, $headers);

 echo font face=\Arial\ size=\2\ color=\#00\Memmber  $Realf
 $RealL from $City $State $Country is been notified.../fontbr  ;
 }

 ?

---John Holmes...


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



Re: [PHP] File array mailing list

2003-03-02 Thread WebDev
well i can not do it I turned the code up side down put the header tags
above like u sugested but still dosnt work  I see your point that it is in a
growing loop  /but I am not so good yet in php to fix the code my self to do
it in a better way
I looked online ??? Does nobody has a data file like mine with name and
email addreses and info in and uses the data to mail his clients all at
ones??? Please if it that is easy for you can u help me out ?


- Original Message -
From: John W. Holmes [EMAIL PROTECTED]
To: 'WebDev' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 7:50 PM
Subject: RE: [PHP] File array mailing What to do


  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=\#00\  mail to
 $Realf
  $RealL done .../fontbr  ;
  }
  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



RE: [PHP] File array mailing list

2003-03-02 Thread John W. Holmes
Instead of using fopen(), try using file(). It will read your file into
an array, with each line of your file being an element in the array. You
then use foreach() to loop through the array, one element (line) at a
time and act accordingly. 

$lines = file($email_file);
foreach($lines as $line)
{
  list ($User, $UserN, $Pass, $Date, $Realf, $RealL, $Email,$Street,
  $City, $State, $Postal, $Country, $Phone, $Webaddress, $ex1, $ex2,
  $ex3,$ex4, $ex53, $ex7 ) = explode(|, $buffer);

  //send emails
}

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: WebDev [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 03, 2003 2:22 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] File array mailing list
 
 well i can not do it I turned the code up side down put the header
tags
 above like u sugested but still dosnt work  I see your point that it
is in
 a
 growing loop  /but I am not so good yet in php to fix the code my self
to
 do
 it in a better way
 I looked online ??? Does nobody has a data file like mine with name
and
 email addreses and info in and uses the data to mail his clients all
at
 ones??? Please if it that is easy for you can u help me out ?
 
 
 - Original Message -
 From: John W. Holmes [EMAIL PROTECTED]
 To: 'WebDev' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Sunday, March 02, 2003 7:50 PM
 Subject: RE: [PHP] File array mailing What to do
 
 
   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=\#00\  mail to
  $Realf
   $RealL done .../fontbr  ;
   }
   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