How Can I Generate an Email List from a MySQL Table
| From: | Roger Lewis | Date: | Sun, 18 Aug 2002 03:10:02 +0000 |
| Subject: | How Can I Generate an Email List from a MySQL Table | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-113100@lists.php.net to get a copy of this message | ||
I have a MySQL table named "users" in which there is a column named
"email_address" and another named "is_subscribed". I would like to send an
email to all of the addresses for which "is_subscribed" is true. I think I
know how to send the email, i.e.,
mail($to, $subject, $message, $headers);
I tested this out and it works fine when, for instance, $to =
"recipient1@abc.com, recipient2@xyz.com" or some such collection of
addresses.
My problem is how do you create the variable, $to, from the MySQL table so
that it contains all of the addresses separated by commas.
Thanks for your help,
Roger Lewis