Send Emails to selected people

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
chethaka
Forum Newbie
Posts: 1
Joined: Mon Mar 29, 2010 12:23 am

Send Emails to selected people

Post by chethaka »

i want to send a email to selected people in my database.And i know how to use mail() function. :)

from while loop i can retrieve all mail addresses. but how to select addresses separably.

Code: Select all

while($new=mysql_fetch_array($result2)){
$email=$new['email'];
echo $email."<br>";
}
here is the result and how to send mails only to aaaa and cccc.
aaaa@mail.com
bbbb@mail.com
cccc@mail.com
dddd@mail.com

Thanks,
..::chethaka::..
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

Re: Send Emails to selected people

Post by greyhoundcode »

chethaka wrote:i want to send a email to selected people in my database ... here is the result and how to send mails only to aaaa and cccc.
We can hardly answer that if we don't know the criteria for your "selected people."

Might this not be accomplished with your original SQL query, depending on what fields exist in the relevant table? For instance,

Code: Select all

-- Instead of this:
SELECT `email` FROM `customers`;

-- Something like this:
SELECT `email` FROM `customers` WHERE `loyaltyscheme`=TRUE;
Post Reply