faet82 Posted August 16, 2006 Share Posted August 16, 2006 hi, i got a problem in importing email addresses from the database. anyone has ideas about this? it is greatly appreciated. thanks. Quote Link to comment Share on other sites More sharing options...
DocSeuss Posted August 16, 2006 Share Posted August 16, 2006 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? Quote Link to comment Share on other sites More sharing options...
faet82 Posted August 16, 2006 Author Share Posted August 16, 2006 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? Quote Link to comment Share on other sites More sharing options...
tomfmason Posted August 16, 2006 Share Posted August 16, 2006 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 Quote Link to comment Share on other sites More sharing options...
faet82 Posted August 16, 2006 Author Share Posted August 16, 2006 yeah, i already tried that but i still got the same error... what would i do? Quote Link to comment Share on other sites More sharing options...
faet82 Posted August 16, 2006 Author Share Posted August 16, 2006 hey! it worked! thanks guyz! :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.