#!/usr/bin/php setStreamTimeoutWait(5); // Set debug output mode $mail->Debug= false; $mail->Debugoutput= 'echo'; // Set email address for SMTP request // $mail->setEmailFrom('isaac@emac3.hpc.lsu.edu'); $mail->setEmailFrom('root@lonimail.uis.lsu.edu'); // Email to check $email = $argv[1]; $deli='|'; // Check if email is valid and exist if (verifyEmail::validate($email)) { // address appears valid $ret = explode('|', $mail->codeCheck($email)); /* returned code: * 250 - good, address verified * 45x - server refused us * 55x - rejected, invalid e-mail address */ $code = intval($ret[0]); switch (intval($code / 10)) { /* switch */ case 25: print('OK'.$deli.$email."\n"); break; case 45: $msg=$ret[1]; print('Uknown'.$deli.$email.$deli.$code.$deli.$msg."\n"); break; case 55: $msg=$ret[1]; if (false == strpos($msg, 'Protocol error')) { // not a protocol error print('Bad'.$deli.$email.$deli.$code.$deli.$msg."\n"); } // not a protocol error else { // Protocol error print('Bad'.$deli.$email.$deli.$code.$deli.$msg." Unable to determine if address is valid\n"); } // Protocol error break; default: print('Undefined'.$deli.$email.$deli.$code."\n"); break; } /* switch */ } // address appears valid else { /* invlaid address */ print('Invalid'.$deli.$email.$deli.'559'.$deli.'559 <'.$email.'>: Invalidly formed address'."\n"); } /* invlaid address */ ?>