PDA

View Full Version : Mail all users


weir-07
04-01-2008, 02:01 PM
Hey guys,

Im a bit stumped on how to email all of my users - without creating some sort of mailing list which isnt really ideal.

I would like to have a simple form which contains a subject, main content and possibility of an attachement - which takes email information from my SQL Users Database and then emails all users when one presses send.

I understand how to do this with a single user... but not all users... Anybody got any advice?

Arnaud
04-01-2008, 02:10 PM
Why don't you make a loop with a mail() function inside that would send an email to each and every user found in your database?

query your sql database to retrieve all email addresses then ->

while ($i < $rows) {

... mail function here ...

}

Otherwise, you could have all email addresses added to a variable and sent using BCC. For example: $my_bcc_field = "one.two@one.com, two.three@one.com, etc."

But I don't know how many different addresses can fit in one bcc field. There might be some limitations.

Therefore I would go for Option 1 but maybe someone has a better idea...

weir-07
04-01-2008, 02:17 PM
Thanks for that! All sorted now :D

Arnaud
04-01-2008, 04:12 PM
Welcome!

mlseim
04-01-2008, 04:21 PM
If you discover that only about 10 or 20 are getting the emails,
contact your webhost and find out if they have limitations on
how many can be sent each hour or (by the minute). Some webhosts
put timer limits on sending mass emails.