westman Posted June 7, 2013 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? Link to comment Share on other sites More sharing options...
justsomeguy Posted June 7, 2013 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. Link to comment Share on other sites More sharing options...
westman Posted June 7, 2013 Author Share Posted June 7, 2013 could i get some more info on PEAR or an example? I have PEAR installed. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 7, 2013 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. Link to comment Share on other sites More sharing options...
westman Posted June 10, 2013 Author Share Posted June 10, 2013 thank you 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