Re: evaluate my mailing list attempt?
| From: | Erik Price | Date: | Tue, 16 Apr 2002 13:11:31 +0000 |
| Subject: | Re: evaluate my mailing list attempt? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93170@lists.php.net to get a copy of this message | ||
On Monday, April 15, 2002, at 05:24 PM, Police Trainee wrote:
Well, constructed from the help i received from some of you, this is the end result of my attempts to be able to send email to everyone listed in a file and including their names in the email. i would appreciate any feedback or suggestions for simplification, etc.Add some whitespace.
<?$doc="emaillist.dat";$fp=fopen("$doc","r"); $contents = fread ($fp,filesize $doc)); fclose($fp);//read file contents into variable $list=explode("\n",$contents); //explode each dataset into array $size=count($list);//count number of array items $size=$size-1;//subtract one for looping process $counter=0;//set counter while($counter<$size){ //do until no more array items $list2=explode("#",$list[$counter]); //explode each dataset into two separate arrays (name/email) $to=$list2[1];//set "to" to email address $subject="Newsletter"; $msg="Hello $list2[0], bla bla bla"; //include name in message mail("$to,$subject,$msg"); //individual mail during loop $counter++; //increment } ?> i know several of you have expressed concerns about overloading email servers, but since i have less than 20 people on the list, i'm sure it can handle it. __________________________________________________ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com