Extreme
12-12-2003, 08:04 PM
It works OK when I try to send 5, 6 emails from file, but when I try to send 3000 for example, it gives me error "404 file not found", although file is there for sure.. Do I need to add something up because my file with email lists is too big, maybe some buffer or something? Here is my code so see if maybe there is a mistake.
<?php
//OPTIONS UP HERE ;)
$options_use_html = true;
$options_subject = true;
$options_from_name = true;
$options_from_email = true;
$options_mail_body_file = 'body.html';//location of the body file
$options_to_emails = 'list.txt';
$options_urgent = false;//if this is an urgent message
$xheaders .= "X-Mailer: Microsoft Outlook Express 6.00.2600.0000\n"; // mailer
if($options_urgent){$xheaders .= "X-Priority: 6\n";} // Urgent message!
if ($options_use_html){$xheaders .= "Content-Type: text/html;\n charset=iso-8859-1\n";}// Mime type
$messagebody = file_get_contents($options_mail_body_file);
function sendmail($location,$messagebody,$xheaders,$from_name) {
list($to,$firstname,$lastname) = explode('*',$location);
$messagebody = str_replace('{firstname}',$firstname,$messagebody);
$messagebody = str_replace('{lastname}',$lastname,$messagebody);
mail($to, "Subject name", $messagebody,
$xheaders
."From: $from_name < My name >\r\n"
."X-Sender: < myemail@yes.com >\n"
."Return-Path: myemail@yes.com\n");
}
$lenth_to_wait = 5; //in messages
$done = 0;
$curr = @$_GET['curr'];
if($curr == ""){$curr = 0;}
$start = @$_GET['curr'];
if($start == ""){$start = 0;}
$list = file('list.txt');
$lenth = count($list);
while($done < $lenth_to_wait){//&&($curr < $lenth)
if($list[$curr] != ""){
sendmail($list[$curr],$messagebody,$xheaders,$from_name);
}
$curr++;
$done++;
}
echo $lenth_to_wait;
echo " = lenth_to_wait\n<br>";
echo $curr;
echo " = curr\n<br>";
echo $start;
echo " = start\n<br>";
echo $lenth;
echo " = lenth\n<br>";
echo $done;
echo " = done\n<br>";
if($curr < $lenth){
echo "<scr"."ipt>this.location.href='email.php?curr={$curr}';</sc"."ript>";//somthing to make the page advance
}else{
echo "done";
}
?>
<?php
//OPTIONS UP HERE ;)
$options_use_html = true;
$options_subject = true;
$options_from_name = true;
$options_from_email = true;
$options_mail_body_file = 'body.html';//location of the body file
$options_to_emails = 'list.txt';
$options_urgent = false;//if this is an urgent message
$xheaders .= "X-Mailer: Microsoft Outlook Express 6.00.2600.0000\n"; // mailer
if($options_urgent){$xheaders .= "X-Priority: 6\n";} // Urgent message!
if ($options_use_html){$xheaders .= "Content-Type: text/html;\n charset=iso-8859-1\n";}// Mime type
$messagebody = file_get_contents($options_mail_body_file);
function sendmail($location,$messagebody,$xheaders,$from_name) {
list($to,$firstname,$lastname) = explode('*',$location);
$messagebody = str_replace('{firstname}',$firstname,$messagebody);
$messagebody = str_replace('{lastname}',$lastname,$messagebody);
mail($to, "Subject name", $messagebody,
$xheaders
."From: $from_name < My name >\r\n"
."X-Sender: < myemail@yes.com >\n"
."Return-Path: myemail@yes.com\n");
}
$lenth_to_wait = 5; //in messages
$done = 0;
$curr = @$_GET['curr'];
if($curr == ""){$curr = 0;}
$start = @$_GET['curr'];
if($start == ""){$start = 0;}
$list = file('list.txt');
$lenth = count($list);
while($done < $lenth_to_wait){//&&($curr < $lenth)
if($list[$curr] != ""){
sendmail($list[$curr],$messagebody,$xheaders,$from_name);
}
$curr++;
$done++;
}
echo $lenth_to_wait;
echo " = lenth_to_wait\n<br>";
echo $curr;
echo " = curr\n<br>";
echo $start;
echo " = start\n<br>";
echo $lenth;
echo " = lenth\n<br>";
echo $done;
echo " = done\n<br>";
if($curr < $lenth){
echo "<scr"."ipt>this.location.href='email.php?curr={$curr}';</sc"."ript>";//somthing to make the page advance
}else{
echo "done";
}
?>