Re: R: [PHP] mailing multilple addresses...?

From: Date: Thu, 20 Nov 2003 03:36:19 +0000
Subject: Re: R: [PHP] mailing multilple addresses...?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-170380@lists.php.net to get a copy of this message
Hey, Pretty good program, i might use it myself after a few modifications. Much better than the old emails.. eg: "Tristan pretty is out of the office......" :-D Cheers, -Ryan http://Bestwebhosters.com ----- Original Message ----- From: <Tristan.Pretty@risk.sungard.com> To: "Alessandro Vitale" <avitale@tiscali.com> Cc: <php-general@lists.php.net> Sent: Wednesday, November 19, 2003 5:58 PM Subject: Re: [PHP] R: [PHP] mailing multilple addresses...? > Cheers to everyone, it works great! > Easy when I look at it now, but ant it the way... > > I'm off to the pub now.. later... > Tris... > > > > > > "Alessandro Vitale" <avitale@tiscali.com> > 19/11/2003 16:50 > > To > <Tristan.Pretty@risk.sungard.com>, <php-general@lists.php.net> > cc > > Subject > [PHP] R: [PHP] mailing multilple addresses...? > > > > > > > try this: > > if ($action == 'send') { > > $fimail = explode(",", $list); > $count = count($fimail); > $show = "<b>Users that have been mailed:</b><br>"; > $i = 1; > while ($count > $i) { > > mail($fimail[$i], "Subject", $message, $headers); > $show .= "<br>$fimail"; > $i++; > } > > } else if ($action == '') { > > $show = "<b>Users to be mailed:</b><br>"; > > $show .= " > <form method=\"post\" action=\"$PHP_SELF\"> > <textarea name=\"list\" > style=\"width:300px;height:150px;\"></textarea> > <input type=\"hidden\" name=\"action\" > value=\"send\"> > <input type=\"submit\" value=\"Send Mails &gt;&gt;\"> > </form> > "; > > } > > > cheers, > > alessandro > > -----Messaggio originale----- > Da: Tristan.Pretty@risk.sungard.com > [mailto:Tristan.Pretty@risk.sungard.com] > Inviato: mercoledi 19 novembre 2003 17.27 > A: php-general@lists.php.net > Oggetto: [PHP] mailing multilple addresses...? > > > Below is some code, I've written, where I'm trying to do the following... > 1. Display a text box, for a user to enter a number of email addresses, > seperated by a comma. > 2. take that value, split it based on the comma and place that vlaue into > > an array. > 3. Count the No of elements in the array > 4. with a while loop, send to each address in turn > 5. Display each successful address on screen afterwards. > > I think my prob', is in my use of the array, and I can't seem to fathom > why...? > Can anyone shed any light on this one for me... I'm a real fan of figuring > > out this stuff on my own, but time is against me today... > > See below... > > ================================= > > if ($action == 'send') { > > $fimail[] = explode(",", $list); > $count = count($fimail[]); > $show = "<b>Users that have been mailed:</b><br>"; > $i = 1; > while ($count > $i) { > > mail($fimail[], "Subject", $message, $headers); > $show .= "<br>$fimail"; > $i++; > } > > } else if ($action == '') { > > $show = "<b>Users to be mailed:</b><br>"; > > $show .= " > <form method=\"post\" action=\"$PHP_SELF\"> > <textarea name=\"list\" > style=\"width:300px;height:150px;\"></textarea> > <input type=\"hidden\" name=\"action\" > value=\"send\"> > <input type=\"submit\" value=\"Send Mails &gt;&gt;\"> > </form> > "; > > } > > ============================= > > > ********************************************************************* > The information contained in this e-mail message is intended only for > the personal and confidential use of the recipient(s) named above. > If the reader of this message is not the intended recipient or an agent > responsible for delivering it to the intended recipient, you are hereby > notified that you have received this document in error and that any > review, dissemination, distribution, or copying of this message is > strictly prohibited. If you have received this communication in error, > please notify us immediately by e-mail, and delete the original message. > *********************************************************************** > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > ********************************************************************* > The information contained in this e-mail message is intended only for > the personal and confidential use of the recipient(s) named above. > If the reader of this message is not the intended recipient or an agent > responsible for delivering it to the intended recipient, you are hereby > notified that you have received this document in error and that any > review, dissemination, distribution, or copying of this message is > strictly prohibited. If you have received this communication in error, > please notify us immediately by e-mail, and delete the original message. > *********************************************************************** > >

« previous php.general (#170380) next »