ShibSta Posted February 4, 2007 Share Posted February 4, 2007 I want to alert my members of a change that will affect them all but don't know enough about arrays to make the e-mailer... I have a few thousand members and need to know the best way to mass email them of this important update without having the PHP Script time out.. (Something similar to the mass email system in vBulletin or something is what I'm lookin for but I don't know enough about PHP to read through it...) Anyone got a tutorial or a class I can use/look at? Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 4, 2007 Share Posted February 4, 2007 well i've never done it before, never gotten round to making one. so i am not sure if this will timeout your script or not. but here, try this. (this is assuming that your members are in an sql table) $headers = "From: youremail@yourdomain.com"; $subject = "yoursubject"; $msg = <<<html Greetings [user], This is a mass email. Sincerely, Site Admin html; $query = mysql_query("SELECT * FROM members"); while($r = mysql_fetch_array($query)){ $msg = str_replace("[user]", $r['username'], $msg); mail($r['email'], $subject, $msg, $headers); } Hopefully that will work. Quote Link to comment Share on other sites More sharing options...
ShibSta Posted February 4, 2007 Author Share Posted February 4, 2007 Thanks, Can anyone give any feedback, comments, or suggestions to the message above? I don't want to try the script and have it timeout half way though then end up having to send half of the users a 2nd message because if it... :-\ Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted February 4, 2007 Share Posted February 4, 2007 ok, well it looks right, but youd have to try it to find if it works. i know that sometimes my computer will block something liek that on its firewall or whataver, and you might want tp use SMTP or something ALWAYS TRY , you cant debug without trying to run a script Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted February 4, 2007 Share Posted February 4, 2007 you can just turn off the php timeout in your php.ini file. its default is 30 seconds i think. Quote Link to comment Share on other sites More sharing options...
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.