On 08/18/2002 12:10 AM, Roger Lewis wrote:
> 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 =
> "[EMAIL PROTECTED], [EMAIL PROTECTED]" or some such collection of
> 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.
Your best solution is to put all recipients in separate Bcc: headers
(one per line) and send just one message.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php