Link to home
Start Free TrialLog in
Avatar of alicca
aliccaFlag for Malaysia

asked on

IS this code correct?

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

ASKER CERTIFIED SOLUTION
Avatar of Ashish Patel
Ashish Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alicca

ASKER

both also can use... thx
Avatar of alicca

ASKER

how to bold email msg??
Avatar of alicca

ASKER

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>