mani
mani

Reputation: 1044

how to send emails when there is new events created.?

I need some suggestions for sending an email to the content editors of my project(i.e, my admin Admins).

First let me explain my project..

my project is mainly for events(fests) that are occurred in all over my country.

here when user is submitted a new events details into my database, an approval mail will be send to all the Content Editors of my project. if the content editor accept the details then only the events are published in my website.

Here is the main problem i have more than 10 content editors. so, how can i send event approval mails to all content editors..

i know there is a mail package in php and i already used that for sending mail to one person only.

can i use that package in my project..? or is there any other solutions are available for this problem.?

thank you.

Upvotes: 0

Views: 264

Answers (2)

Mardin Yadegar
Mardin Yadegar

Reputation: 437

Use a while loop to continue sending the emails is how I would do it. Make sure to use the PHP mail() function as well. Store all the emails of the people in a database and run a query which will return their emails. From there, use the while loop to get all the emails and put a mail function inside the while loop.

Upvotes: 2

Patrick Evans
Patrick Evans

Reputation: 42736

why not just add everyone's email to the to field of the php mail command

$subject = "Changes";
$message = "Some email message";
mail('[email protected],[email protected],[email protected]', $subject, $message);

php mail

Upvotes: 3

Related Questions