Jump to content


Photo

importing email addresses


  • Please log in to reply
5 replies to this topic

#1 faet82

faet82
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 16 August 2006 - 06:58 AM

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

#2 DocSeuss

DocSeuss
  • Members
  • PipPipPip
  • Advanced Member
  • 73 posts
  • LocationTexas, USA

Posted 16 August 2006 - 07:00 AM

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?
"Unlimited budget? Great, for $5,000,0000 we will run your ad banner for one year"  ----Rasmus Lerdorf

#3 faet82

faet82
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 16 August 2006 - 07:11 AM

yes, im using mysql database. problem is how could i get email address from the database, because the error is Warning: Bad Message destination in c:\apache\htdocs\emailer\email.php on line 66

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

#4 tomfmason

tomfmason
  • Staff Alumni
  • Advanced Member
  • 1,696 posts
  • Locationstealing your wifi

Posted 16 August 2006 - 07:19 AM

have you tried something like this.

$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());
}


Hope this helps,
Tom

Traveling East in search of instruction, and West to propagate the knowledge I have had gained.

current projects: pokersource

My Blog | My Pastebin | PHP Validation class | Backtrack linux


#5 faet82

faet82
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 16 August 2006 - 07:49 AM

yeah, i already tried that but i still got the same error... what would i do?

#6 faet82

faet82
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 16 August 2006 - 08:02 AM

hey! it worked! thanks guyz!  :D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users