Try the following:
if(!(is_array($errors)))
{
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= "From: \"".$from_name."\" <".$from_email.">\n";
$query="SELECT email From newsletter WHERE visible='1'";
$result=mysql_query($query) or mysql_error();
for ($i=0;$rowdata=mysql_fetch_array($result) && $i<200;$i++)
{
$headers .= "To: \"".$to_name."\" <".$rowdata['email'].">\n";
mail($rowdata['email'], "$sub",$message, $headers);
}
}
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
when messing up with mime it is better to use third party packages that will save you pain like PHPMailer or swiftmailer
evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
when messing up with mime it is better to use third party packages that will save you pain like PHPMailer or swiftmailer
I find it better to use the in built mail function because it uses the local mail server rather than a third party mail server. Also using the mail function can speed things up if you have configured the mail function correctly in the php.ini file along with an active mail server on the local server. :)
cwarn23
Occupation: Genius
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
I find it better to use the in built mail function because it uses the local mail server rather than a third party mail server. Also using the mail function can speed things up if you have configured the mail function correctly in the php.ini file along with an active mail server on the local server. :)
I agree with you but for newbees, dealing with mime is not funny :)
evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392