/* * 服务器状态监控 */ header('Content-type:text/html;charset=utf-8'); include './smtp/class.smtp.include './smtp/class.function sendmail($subject = '',$body = '') { date_default_timezone_set('Asia/Shanghai');//设定时区东八区 $mail = new // $body = eregi_replace("[]",'',$body); //对邮件内容进行必要的过滤 $mail->CharSet ="UTF-8";//设定邮件编码,默认ISO-8859-1,如果发中文此项必须设置,否则乱码 $mail->IsSMTP(); // 设定使用SMTP服务 $mail->SMTPAuth = true; // 启用 SMTP 验证功能 $mail->Host = 'smtp.exmail.qq.com'; // SMTP 服务器 $mail->Port = 25; // SMTP服务器的端口号 $mail->Username = '[email protected]'; // SMTP服务器用户名 $mail->Password = 'password'; // SMTP服务器密码 $mail->SetFrom('[email protected]','Status'); $mail->AddReplyTo('[email protected]','Status'); $mail->Subject = $subject; $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional, comment out and test $mail->MsgHTML($body); $address = '[email protected]'; //接收邮箱 $mail->AddAddress($address, ''); //$mail->AddAttachment("images/ //$mail->AddAttachment("images/ if(!$mail->Send()) { echo 'Mailer Error: ' . $mail->ErrorInfo; } else { // echo "Message sent!恭喜,邮件发送成功!"; } } //check server status function checkServerSatatus($ip) { $str = null; $fp = @fsockopen($ip,80,$errno,$errstr,10); if (!$fp) { return false; } else { fclose($fp); return true; } } $server_ip_list = array( '61.135.169.121', '221.204.173.200', '173.194.127.83' ); ?>
|