/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// PHP.ini : allow_call_time_pass_reference = On // somenone can override this ? function neo_mailCheck($Email){ // email well formatted ? can use SANITIZE stuff if(!preg_match('`^[[:alnum:]]([-_.]?[[:alnum:]])*@[[:alnum:]]([-_.]?[[:alnum:]])*\.([a-z]{2,4})$`', $Email)){ } // Get domain // Cherching data MX in DNS $ConnectAddress = $MXHost[0]; } else { $ConnectAddress = $domain; } // Creating connexion on smtp port (25) if($Connect){ // test return 220 "); "); "); "); // If command RCPT TO returns 250 ou 251 (cf: RFC) // Son email exist // Adress rejected by server return false; } else { // Adress accepted by server return true; } } else { // Server not answered return false; } } else { // Login on mail server impossible // You can see error with this : // echo $errno."-".$errstr; return false; } }