Jump to content

Archived

This topic is now archived and is closed to further replies.

shopies

mailling a group of users

Recommended Posts

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

Share this post


Link to post
Share on other sites
Hi

If 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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
ok then you need to check for a value in your db that corresponds to the user having a new group

say 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]

Share this post


Link to post
Share on other sites
As promissed, the zipped file can be found here:
http://www.oriosriddle.com/email.rar

Go over the files, there's many things you'll need to modify so it will suit your site :)

Orio.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.