[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

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.
0
sdieken
Asked:
sdieken
  • 2
  • 2
1 Solution
 
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!
0
 
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?
0
 
sdiekenAuthor Commented:
Please give me some idea please!
0
 
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 ;)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now