We help IT Professionals succeed at work.

IS this code correct?

alicca
alicca asked
on
314 Views
Last Modified: 2010-04-21
i wan to retrive email list from database and send it..
so can some 1 help me check is this code correct?
$reclist = mysql_query("SELECT mailadres FROM signup") 
               or die(mysql_errno()." : ".mysql_error());
 
while($rec=mysql_fetch_assoc($reclist)){
     $emaillist = $rec['mailadres']; 
            
}
 
$allemails = split("\n", $emaillist);
$numemails = count($allemails);
 
          for($x=0; $x<$numemails; $x++){
                $to = $allemails[$x];
                if ($to){
                $to = ereg_replace(" ", "", $to);
  
                flush();
                $header = "From: $realname";
                $header .= "MIME-Version: 1.0\r\n";
	       mail($to, $subject, $messege, $header);
				}
		 }

Open in new window

Comment
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
both also can use... thx

Author

Commented:
how to bold email msg??

Author

Commented:
i use below as my msg

$messege = "


This company is looking to pay you <b> $money </b>right now!
 
If you want to make a quick<b> $money </b>today taking an online survey, sign up with them here:

<A href=\"http://www.gr8surveys.com/members/\"> $mylink </A>
 


<b>GR8Surveys</b>";




but the result is


This company is looking to pay you <b> $140 </b>right now!

If you want to make a quick<b> $140 </b>today taking an online survey, sign up with them here:

<A href="http://www.gr8surveys.com/members/ "> http://www.mb01.com/lnk.asp?o=1302&c=18197&a=14330 </A>



<b>GR8Surveys</b>
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.