Send a mail to a group of people

Hi all,

My site allows visitor to choose a mark of category. For example, my site has 3 categories : A, B and C. Now I want to send a mail to a group of visitor. For example, I want to send a mail to all visitor who chose A. I want to send only one mail then that mail will forward to all visitor who chose category A. How can I do that esily?

Thanks.
sdiekenAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TomeeboyCommented:
You'll probably want to use some kind of mail class, such as PHPmailer:
http://phpmailer.sourceforge.net/

Then, for what you're wanting to do, you would need to build a BCC (blind carbon copy) list of email addresses to send your emails to (which could be done by looping through a result array of email addresses queried from your database, based on the chosen category).

Here's a guide that will show you how to use PHPmailer for things like BCC:
http://www.phpfreaks.com/tutorials/130/0.php

Hope that helps!
sdiekenAuthor Commented:
Yes! I used to do it. But some problems occur when there are many emails to send. The script will be time out :(
Do you understand what I mean? How can I solve this problem?
sdiekenAuthor Commented:
Please give me some idea please!
TomeeboyCommented:
Try changing the maximum script execution time in your PHP script:
http://www.php.net/set_time_limit

It would also help to break up your emails into batches and send one batch at a time.

Hope that helps ;)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.