日期:2014-05-17 浏览次数:20508 次
if (isset($_GET['act']) && $_GET['act'] == 'sendMail') {
sendEmail();// 发送邮件操作
}
function fSockGet($url, $timeout = 3)
{
$info = parse_url($url);
extract($info);
$query = isset($query) ? trim($query) : '';
$path = isset($path) ? trim($path) : '';
$fp = fsockopen($host, 80, $errno, $errstr, $timeout);
if (!$fp) {
exit("$errstr ($errno)<br>\n");
}
$write = fwrite($fp, "GET {$path}?{$query} HTTP/1.0\r\nHost: {$host}\r\n\r\n");
// while (!feof($fp)) {
// echo fread($fp, 4096);
// }
}
$url = "http://mydir.com/index.php?act=sendMail";
$emailList = array(...);
foreach ($emailList as $email) {
fSockGet($url);
}