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 >>\"> </form> "; } cheers, alessandro -----Messaggio originale----- Da: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Inviato: mercoledi 19 novembre 2003 17.27 A: [EMAIL PROTECTED] 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 >>\"> </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