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 Link to comment https://forums.phpfreaks.com/topic/16779-mailling-a-group-of-users/ 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] Link to comment https://forums.phpfreaks.com/topic/16779-mailling-a-group-of-users/#findComment-70574 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. Link to comment https://forums.phpfreaks.com/topic/16779-mailling-a-group-of-users/#findComment-70579 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. Link to comment https://forums.phpfreaks.com/topic/16779-mailling-a-group-of-users/#findComment-70584 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 Link to comment https://forums.phpfreaks.com/topic/16779-mailling-a-group-of-users/#findComment-70586 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] Link to comment https://forums.phpfreaks.com/topic/16779-mailling-a-group-of-users/#findComment-70598 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. Link to comment https://forums.phpfreaks.com/topic/16779-mailling-a-group-of-users/#findComment-70605 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.