I have a php mail script that i use to send out a newsletter (html). the script loads all the email addresses as bcc but somehow after about 50 names the bcc addresses get written itno the body of the email! so much for anonimity! I tested this so many times and it looks fine to me (code below) anyone have any ideas why this would happen?
thanks
<?php
/*
*/
include_once "mlconfig.php";
echo "
<div align=center>
<table width=100% border=$BORDER_WITDH cellspacing=0 cellpadding=0 bordercolor=$COLOR_FRAME>
<tr bgcolor=$COLOR_TABLEHDR><td><a href=http://www.subatomicfactory.com><b>Mail List v1.01</b></a> :: Using the mailing list
</td></tr><tr><td><br>
<form name=Email method=POST action=$_SERVER[PHP_SELF]>
<table width=100% border=0><tr><td>
List name:</td><td> <input type=text name=List_name value='test list' size=35></td></tr><tr><td>
Subject:</td><td> <input type=text name=Mail_subject size=50></td></tr><tr><td>
</td><td><textarea name=Email_message cols=80 rows=10></textarea></td></tr><tr><td>
Password:</td><td> <input type=password name=List_Password size=35><br>
<input type=submit name=Email_submit value=\"Send message to mailing list..\">
</td></tr></table>
</form></td></tr><tr bgcolor=$COLOR_TABLEHDR><td>
";
if (isset($List_name) && isset($Mail_subject) && ISSET($Email_message) && empty($List_name) == false && empty($Mail_subject) == false && empty($Email_message) == false) {
if (isset($List_Password) && empty($List_Password) == false && $List_Password == $Password) {
$link = mysql_connect($SQL_HOST, $SQL_USER, $SQL_PWD)
or die(mysql_error());
if ($debug == true) { print "<br>Connection established..<br>"; };
mysql_select_db($SQL_DB)
or die(mysql_error());
$query= "SELECT * FROM $SQL_TABLE WHERE (ML_LISTNAME LIKE \"$List_name\")";
if ($debug == true) { print "<br>$query<br>"; };
$result = mysql_query($query)
or die(mysql_error());
$footer_message = preg_replace("/([^\s]{100})/", "$1\n", $footer_message);
$Email_message = preg_replace("/([^\s]{100})/", "$1\n", $Email_message);
$sql_numrows = @mysql_num_rows($result);
if ($sql_numrows !== 0) {
while ($sql_row = @mysql_fetch_array($result)) {
$test_addrs .= $sql_row["ML_ADDR"] . ", ";
}
$headers .= "Content-Type: text/html\n";
$headers .= "Content-Transfer-Encoding: 7bit;\n ";
$headers .= "charset=iso-8859-1\n";
$headers .= "From: $response_email\n";
$headers .= "Bcc: $test_addrs\n";
if (mail($response_email, $Mail_subject, "$Email_message<hr>$footer_message", $headers) == true) {
echo "Message succesfully send to $test_addrs<br>";
}
else {
echo "Unable to send message to $test_addrs</br>";
}
mysql_free_result($result);
mysql_close($link);
}
else {
echo "There are no email addresses in the specified list.";
}
}
else {
echo "<b>The password you specified is not correct.</b>";
}
}
else {
echo "
<li>Enter the name of the mailinglist</li>
<li>Enter the subjectline of your email</li>
<li>Enter the bodytext of your email</li>
<li>Enter your password for verification</li>
<li>Press the send message button</li>
";
}
echo "
</td></tr><tr bgcolor=$COLOR_TABLEHDR><td></td></tr></table>
";
?>