I am using lynx at the command line to run a script that is reading a directory, checking file sizes, and sending an email based on a => certain number. The email that comes throught chops off at a certain point. I am not sure if lynx has a setting that only allows a certain "" of email to come through, but these emails are maybe 3 to 4 "k".
Here is the code, please submit any ideas.
thanx
<?php
$handle=opendir('/var/mail/');
$dir_files = array();
while ($file = readdir($handle))
{
if($file != ".." && $file != "." && $file !="index.php" && $file !="next.php" && $file !="second.php" && $file !="refresh.php")
{
$dir_files[] = $file;
}
}
sort($dir_files);
##$to .= "josephwood@nicholasandco.com" . ", " ;
$to .= "christopher.leon@nicholasandco.com";
$subject = "Email Bandits";
$b = "<b>";
$unb = "</b>";
$body = ""; //Initialize the variable to store the email
$body .= "<table border=\"0\">";
$body .= "<tr><td><font size=\"5\" color=\"black\"><b>OVER THE LIMIT MAILBOXES</b></font></td></tr>";
$body .= "</table>";
$body .= "<table border=\"1\">";
$body .= "<tr><td><font size=\"4\" color=\"black\"><b>Number</b></font></td><td><font size=\"4\" color=\"black\"><b>POP Acct</b></font></td><td><font size=\"4\" color=\"black\"><center><b>Size</b></center></font></td><td><font size=\"4\" color=\"black\"><center><b>Date</b></center></font></td></tr>";
for($i=0; $i<=300; $i++)
{
$file_size = "/var/mail/$dir_files[$i]";
$file_date = "/var/mail/$dir_files[$i]";
$filesize = filesize($file_size);
$filedate = date( "D m/d/Y h:i:s a", filemtime( $file_date ) );
if($filesize >= 1000000){
$bgcolor = "#CCCCFF";
}
if($filesize >= 2000000){
$bgcolor = "#CC99CC";
}
if($filesize >= 3000000){
$bgcolor = "#99CC99";
}
if($filesize >= 1000000){
$body .= "<tr>";
$body .= "<td bgcolor=$bgcolor>Email Bandit$i:</td><td bgcolor=$bgcolor><font size=3><center>$b $dir_files[$i] $unb</center></font></td><td bgcolor=$bgcolor><font size=3><center>$b $filesize $unb</center></font></td><td bgcolor=$bgcolor><font size=3><center>$b $filedate $unb</center></font></td>";
$body .= "</tr>";
}
}
$body .= "</table>";
/ additional header pieces for errors, From cc’s, bcc’s, etc /
$headers .= "From: Email Reports\n";
$headers .= "Return-Path: <chrisleon@nicholasandco.com>\n"; // Return path for errors
/ If you want to send html mail, uncomment the following line /
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
mail($to, $subject, $body, $headers); // send the email
closedir($handle);
?>