westman 10 Posted June 7, 2013 Report Share Posted June 7, 2013 hi all, i am back i need to send mass emails to hundreds of members at the same time using a cron job.i have this script... $sql = mysql_query("SELECT * FROM members WHERE emailactivated = '0'");while($row = mysql_fetch_array($sql)){$email_add = $row["email"];$to = "$email_add";$from = "admin@mysite.com";$subject = "sign up";$message = '<html><body bgcolor="#FFFFFF">hello</body></html>';$headers = "From: $from\r\n";$headers .= "Content-type: text/html\r\n";mail($to, $subject, $message, $headers);} will this work? Quote Link to post Share on other sites
justsomeguy 1,135 Posted June 7, 2013 Report Share Posted June 7, 2013 It will work, but it's probably going to take a while to finish. The mail function isn't very efficient for large email volume. You may want to use the PEAR Mail package instead. Quote Link to post Share on other sites
westman 10 Posted June 7, 2013 Author Report Share Posted June 7, 2013 could i get some more info on PEAR or an example? I have PEAR installed. Quote Link to post Share on other sites
justsomeguy 1,135 Posted June 7, 2013 Report Share Posted June 7, 2013 http://www.google.com/search?client=opera&q=pear+mass+mail+examples&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest I use the Mail Queue package to send mass mail in my applications. Quote Link to post Share on other sites
westman 10 Posted June 10, 2013 Author Report Share Posted June 10, 2013 thank you Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.