1) { /* Each log entry has 6 lines, so adjust for this */ $log_entries = (count($results) / 6); /* If more than the defined number of logs, send e-mail and zap file */ if ($log_entries >= $mailconfmin) { /* Convert the array to a string for sending mail */ reset ($results); $message = "\n\n"; while (list(, $resultl) = each ($results)) { $message .= $resultl; } /* Now send the mail */ if (mail($mailconfto, $mailconfsubject, $message, "From: $mailconffrom")) { /* Mail sent so zap the file */ $fp = @fopen($logfile, "w"); if ($fp) { fclose($fp); } } } } } } ?>