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
chethaka
Forum Newbie
Posts: 1 Joined: Mon Mar 29, 2010 12:23 am
Post
by chethaka » Mon Mar 29, 2010 12:33 am
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::..
greyhoundcode
Forum Regular
Posts: 613 Joined: Mon Feb 11, 2008 4:22 am
Post
by greyhoundcode » Mon Mar 29, 2010 7:16 am
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;