We help IT Professionals succeed at work.

Send a mail to a group of people

sdieken
sdieken asked
on
Medium Priority
210 Views
Last Modified: 2009-07-29
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.
Comment
Watch Question

CERTIFIED EXPERT

Commented:
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!

Author

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?

Author

Commented:
Please give me some idea please!
CERTIFIED EXPERT
Commented:
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 ;)

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.