check email 存不存在

if ($_SERVER[argc]<2) { printf(“Usage : %s filename\n”,$_SERVER[‘argv’][0]); exit; } $filename=strftime(“%H%M.txt”); $out=fopen($filename,”a”); $counter=0; $fp=fopen($_SERVER[‘argv’][1],”r”); while ($data=fgets($fp,2000)) { $data=str_replace(“\r”,””,$data); $data=str_replace(“\n”,””,$data); if (checkmail($data)==TRUE) { printf(“%s : %s \tGOOD_EMAIL!\n”,$counter,$data); fputs($out,$data.”\n”); } else printf(“%s : %s \tBAD_EMAIL!\n”,$counter,$data); $counter++; } fclose($fp); fclose($out); exit; // ——- function checkmail($mail){ $host = explode(‘@’,$mail); list($account,$host) = $host; if (!getmxrr($host,$mxa)) $mxa = array($host); while (list ($key, […]