Send a mail to a group of people

Posted on 2006-03-20
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?

Question by:sdieken
    LVL 15

    Expert Comment

    You'll probably want to use some kind of mail class, such as PHPmailer:

    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:

    Hope that helps!

    Author Comment

    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 Comment

    Please give me some idea please!
    LVL 15

    Accepted Solution

    Try changing the maximum script execution time in your PHP script:

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

    Hope that helps ;)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    A colleague recently asked me about how to give his client a small part of the web site that could be completely under the client's control.  Since I have done this sort of thing before to add emergency banners to a web site, I decided I would creat…
    Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now