Jump to content

Archived

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

faet82

importing email addresses

Recommended Posts

hi, i got a problem in importing email addresses from the database. anyone has ideas about this? it is greatly appreciated. thanks.

Share this post


Link to post
Share on other sites
Might be able to offer help if you be more specific about the problem you are having. Error...incorrect address.....ect. Is the database mysql?

Share this post


Link to post
Share on other sites
yes, im using mysql database. problem is how could i get email address from the database, because the error is [i]Warning: Bad Message destination in c:\apache\htdocs\emailer\email.php on line 66[/i]

how could i loop that each email address from the database will print to $recipient one by one?

Share this post


Link to post
Share on other sites
have you tried something like this.

[code=php:0]
$sql = mysql_query("SELECT `email` FROM `yourtable` WHERE `something` = '$something'") or die mysql_error());
while ($rw = mysql_fetch_assoc($sql)) {
        $recipent = $rw['email'];
        $subject = "Something";
        $message = "Something else";
        //this below is a simple mail format. I would change this. I only posted it to give you an idea
        mail($recipent, $subject, $message, "From: You<You@yoursite.com>\nX-Mailer: PHP/" . phpversion());
}
[/code]


Hope this helps,
Tom

Share this post


Link to post
Share on other sites
yeah, i already tried that but i still got the same error... what would i do?

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.