// $mailer->AddAttachment('./'.$tarName, "$tarName");//附件的路径和附件名称 if ($mailer->Send()) { echo "send email {$subject} successful!"; } else { echo "sendmail wrong" . $mailer->ErrorInfo; } // shell_exec("rm $tarName"); // shell_exec("rm $filename"); } header("Content-Type: text/html; charset=utf-8"); $rl = new AccessLog(); $filename = 'C:\\Users\\N010D90001\\Downloads\\abc.log'; // 对文件名的编码,避免中文文件名乱码 $filename = iconv("UTF-8", "GBK", $filename); $files = array($filename); $logdate = $rl->getLogDate($files[0]); $title = 'Nginx日志统计 ' . $logdate; $html = <<<HTML <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{$title}</title> </head> <style type="text/css"> body {font-size: 12px; font-family: Arial, Helvetica, sans-serif; } table#dd {background-color: #6CADD9;white-space:nowrap;} table#dd thead th {background-color: #6CADD9;color: #FFFFFF;font-size: 12px;} table#dd td {padding: 6px;width: 120px;} table#dd tbody.tb1 td {background-color: #FFFFFF;} table#dd tbody.tb2 td {background-color: #F7F7F7;} table#dd tbody td:hover {background-color: #BFEDF9;}