sending mail to all addresses in database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
some_new_guy
Forum Newbie
Posts: 10
Joined: Thu Mar 25, 2004 10:58 am

sending mail to all addresses in database

Post by some_new_guy »

Hi there.

I'm relatively new to php. I have set up a database which collects information from users; one piece of the information includes their email address.

What I'd like to know is how I can email all of these members at once. I'm assuming I need to use a form, with a script that connects to the database. However, I'm unsure how to approach this.

Again, I'm fairly new, so take it easy on me.....

Thanks in advance.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Look into mail(): http://www.php.net/manual/en/function.mail.php . There may be a way to email multiple addresses at once.

Another way to do it is to send an individual email for each email address, rather than one email for everyone.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

what I usually do is generate a comma separated list of the email addresses and send only one mail.

that way you're not making several calls to the mail server for one purpose...
Post Reply