shopies Posted August 7, 2006 Share Posted August 7, 2006 Hi,I'm tryng to make a mailling list program to email multi users in one shot. My problem is I don't know how to get the users that registered in a specific group and send them an email. The mailling groups IDs are saved in one of the users columns devided by "|".Any help would be highly appreciated in advance :)Shopies Quote Link to comment Share on other sites More sharing options...
glenelkins Posted August 7, 2006 Share Posted August 7, 2006 HiIf the user emails are in a database you need to loop through the users emails to email them all example:[code]$result = mysql_query("SELECT * FROM users");while ($userArray = mysql_fetch_array($result)) { mail ($userArray['email'],"Title","Body","Headers");}[/code] Quote Link to comment Share on other sites More sharing options...
Orio Posted August 7, 2006 Share Posted August 7, 2006 I have a script that does what you are talking about. Do want me to upload a zip file with all of the files I use?Orio. Quote Link to comment Share on other sites More sharing options...
shopies Posted August 7, 2006 Author Share Posted August 7, 2006 Yes please Orio it would be highly appreciated. Quote Link to comment Share on other sites More sharing options...
shopies Posted August 7, 2006 Author Share Posted August 7, 2006 Hi glenelkins and thanks for replying. I know how to email them all at once but my problem is that I have mailling groups like (news, articles, pictures ...etc) and I want just to email the users subscribed in news group or articles group.Thanks Quote Link to comment Share on other sites More sharing options...
glenelkins Posted August 7, 2006 Share Posted August 7, 2006 ok then you need to check for a value in your db that corresponds to the user having a new groupsay the field: NEWS_GROUP = 1[code]$result = mysql_query("SELECT * FROM users");while ($userArray = mysql_fetch_array($result)) { if ($userArray['NEWS_GROUP'] == 1) { mail ($userArray['email'],"Title","Body","Headers"); }}[/code] Quote Link to comment Share on other sites More sharing options...
Orio Posted August 7, 2006 Share Posted August 7, 2006 As promissed, the zipped file can be found here:http://www.oriosriddle.com/email.rarGo over the files, there's many things you'll need to modify so it will suit your site :)Orio. 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.