francis Aneke Posted April 26, 2015 Share Posted April 26, 2015 how can one send email message to multiple emails in a database using php. The code has to fetch out the emails one by one and then send the message to them Link to comment Share on other sites More sharing options...
justsomeguy Posted April 27, 2015 Share Posted April 27, 2015 You can either use a loop to send an email to each address, or put each address in the CC header if you want to send one email to a group. Link to comment Share on other sites More sharing options...
francis Aneke Posted April 29, 2015 Author Share Posted April 29, 2015 Can you give me a code hint? Link to comment Share on other sites More sharing options...
justsomeguy Posted April 29, 2015 Share Posted April 29, 2015 What code are you using now to send the email? If you use a loop then you just put that code inside the loop that gets each address. If you want to use the CC header then that's just one more thing to add to the email headers. Link to comment Share on other sites More sharing options...
francis Aneke Posted April 30, 2015 Author Share Posted April 30, 2015 Am frankly using php if u can give me a hint may be by using for loop or for each statement to iterate through all the emails in the database and pass the message to all of them Link to comment Share on other sites More sharing options...
justsomeguy Posted April 30, 2015 Share Posted April 30, 2015 It's just a regular foreach loop, I'm not sure where your confusion is. foreach ($emails as $email) { // send the email to $email}There are several ways to actually send the email. Phpmailer is a popular choice. Link to comment Share on other sites More sharing options...
francis Aneke Posted May 1, 2015 Author Share Posted May 1, 2015 (edited) still couldn't solve it. Remember that all the emails are being fetched out of database........ So its like you didnt note that one.. There are several ways to actually send the email. Phpmailer is a popular choice. please how? Edited May 1, 2015 by francis Aneke Link to comment Share on other sites More sharing options...
justsomeguy Posted May 1, 2015 Share Posted May 1, 2015 It's up to you to get the emails from the database. It's your database, you should be able to do that. If you don't know how to get information out of the database, check the tutorials.Did you search for PHPmailer?https://github.com/Synchro/PHPMailer Link to comment Share on other sites More sharing options...
Chikwado Posted May 2, 2015 Share Posted May 2, 2015 @Francis Aneke, Also read from this link: http://stackoverflow.com/questions/3226138/how-to-send-e-mail-to-multiple-recipients-from-database-query-php But I am afraid to post this link because I don't know If it violate w3schools policy. Link to comment Share on other sites More sharing options...
francis Aneke Posted May 3, 2015 Author Share Posted May 3, 2015 No you did well chikwado, it does not violate w3schools policy,its ok because even moderators are making that kind of reference, so far it can help at all cost......Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now