cvs: phpweb /include check_email_func.php email-validation.inc

From: Date: Wed, 28 Feb 2001 11:55:52 +0000
Subject: cvs: phpweb /include check_email_func.php email-validation.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-4066@lists.php.net to get a copy of this message
jmcastagnetto Wed Feb 28 03:55:52 2001 EDT Added files: /phpweb/include check_email_func.php Modified files: /phpweb/include email-validation.inc Log: Modified email validation function to print out debugging info. Added testing script: check_email_func.php, when used as: http://www.php.net/include/chec_email_func.php?debug=1 it will do the validation with a set of email addresses and print out debugging info. Index: phpweb/include/email-validation.inc diff -u phpweb/include/email-validation.inc:1.2 phpweb/include/email-validation.inc:1.3 --- phpweb/include/email-validation.inc:1.2 Sun Oct 22 18:13:07 2000 +++ phpweb/include/email-validation.inc Wed Feb 28 03:55:51 2001 @@ -4,7 +4,7 @@ /* * email_validation.php * - * @(#) $Header: /local/repository/phpweb/include/email-validation.inc,v 1.2 2000/10/23 01:13:07 jmcastagnetto Exp $ + * @(#) $Header: /local/repository/phpweb/include/email-validation.inc,v 1.3 2001/02/28 11:55:51 jmcastagnetto Exp $ * */ @@ -153,13 +153,13 @@ } -function is_emailable_address( $email ) { +function is_emailable_address( $email, $debug=0 ) { $hosts_regex="lists\.php\.net|chek.*\.com"; $excluded_hosts = ereg($hosts_regex,$email); if (!$excluded_hosts && $email != "") { $validator = new email_validation_class; $validator->timeout=10; - //$validator->debug=1; + $validator->debug=$debug; return $validator->ValidateEmailBox($email); } else { return false; Index: phpweb/include/check_email_func.php +++ phpweb/include/check_email_func.php <html> <head><title>email validation test</title></head> <body> <?php require "email_validation.inc"; if (!$debug) $debug = 0; $test_add = array ( "wrong-email-address@lists.php.net","jmcastagnetto@yahoo.com", "some-wrong@asdas.com", "jcastagnetto-NO-SPAM@yahoo.com", "jcastagnetto@NoSpam-yahoo.com", "jmcastagnetto@chek2.com", "jcastagnetto-i-hate-spam@NOSPAMyahoo.com", "jesusmc@scripps.edu", "asasasd324324@php.net", "jcastagnetto-delete-this-@yahoo.com", "wrong-address-with@@@@-remove_me-and-some-i-hate_SPAM-stuff"); while (list(,$v) = each($test_add)) { echo "The address: $v (".clean_AntiSpam($v).") is"; if (!is_emailable_address(clean_AntiSPAM($v), $debug)) echo " not"; echo " valid\n<br>"; } ?> <hr> The jesusmc@scripps.edu, jmcastagnetto@yahoo.com and jcastagnetto@yahoo.com should validate OK as of 2001-02-28 --- JMC </body> </html>

« previous php.mirrors (#4066) next »