I have found an easier way to send mass email. It works but i am not sure if it is the most efficient:
| Code: : |
$emailsql="select email from pie_mail where subscribe='Y'";
$runemail=mysql_query($emailsql)or die (mysql_error());
$email_num=mysql_num_rows($runemail);
$i=0;
while ($row_Email=mysql_fetch_assoc($runemail)){
$mynum=$row_Email['email'];
$i++;
$from="
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
";
$to=$mynum;
$headers = "MIME-Version: 1.0" . "\r_CRLF_";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r_CRLF_";
$headers .= "From: $from" . "\r_CRLF_";
$body=$message;
$subject=$title;
if (mail($to, $subject, $body, $headers)){
echo "<div class=\"row2\"><font class=\"style4\"><img src=\"../images/tick.png\" width=\"16\" height=\"16\" />
$mynum Subscription message sent!</font></div><br>";
}else {
echo "<div class=\"row2\"><font class=\"style4\"><img src=\"../images/cancel.png\" width=\"16\" height=\"16\" />
$mynum Subscription message fail to deliever!</font></div><br>";
}
}
|
Only thing is that the headers for html does not work. Maybe one of you all could fix it for me.