RE: [PHP] How Can I Generate an Email List from a MySQL Table
| From: | Roger Lewis | Date: | Sun, 18 Aug 2002 04:20:08 +0000 |
| Subject: | RE: [PHP] How Can I Generate an Email List from a MySQL Table | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113103@lists.php.net to get a copy of this message | ||
Thanks for the quick responses from Chris, Daren, and Kevin. I didn't know
so many would be up Sat night.
This looks like it might do the trick since I only have 20 to 30 recipients
and I have a dedicated server. I'll check it out and let you know.
Thanks again,
Roger
-----Original Message-----
From: Chris Knipe [mailto:savage@savage.za.org]
Sent: Saturday, August 17, 2002 8:37 PM
To: Roger Lewis; Php-General
Subject: Re: [PHP] How Can I Generate an Email List from a MySQL Table
$to = '';
while ($blah = mysql_fetch_row($ref)) {
$to =+ $blah['address'];
};
Be careful however. Most SMTP servers has a limit on the number of
recipients you can send one email to. It's a very easy way to trigger spam
alerts and stuff.
--
me
----- Original Message -----
From: "Roger Lewis" <re.lewis@attbi.com>
To: "Php-General" <php-general@lists.php.net>
Sent: Sunday, August 18, 2002 5:10 AM
Subject: [PHP] How Can I Generate an Email List from a MySQL Table
> 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
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>