Hello all,
I am trying to create a HTML email script for news letters. I pull all my email address's from a database and put them into an array. I try to send them out with BCC in the mail() function but it seems only certain emails get out or non at all.
$address = array();
// Grab emails from database
$sql_address = "SELECT EMAIL FROM mailinglist WHERE ACTIVE='1'";
$result_address = mysql_query($sql_address) or die ("<b><center style='color:red;'>".mysql_errno().": ".mysql_error()."</b></center>\n");
while ($rowsaddress = $rows_address = mysql_fetch_array($result_address, MYSQL_ASSOC)){
//$address[] = $rowsaddress["EMAIL"].",".$address;
$address[] = "<".$rowsaddress["EMAIL"].">";
}
$list = implode(", ",$address);
$headers = "From: News Letter <noreply@domain.com>\n";
$headers .= "Return-Path: noreply@domain.com\n";
$headers .= "Bcc: ".$list."\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/HTML; charset=ISO-8859-1\n";
$headers .= "Content-Transfer-Encoding: 8bit\n";
$headers .= "X-Mailer: PHP\n";
$body = "<html><head><title>News Letter</title></head><body>\n";
$body .= $_POST["fck1"]."\n";
$body .= "</body></html>\n";
mail("noreply@domain.com", $_POST["subject"], wordwrap($body, 70), $headers);
any help would be great!