|
Description:
The only way to really know whether an email address is valid is to try
sending mail to it. i.e., no simple regular expression exists which can
verify the correctness of any given email address. The Mail::CheckUser
module (available on CPAN) verifies that a particular email address is valid
by first checking the syntax of the email address, then checking whether an
email server exists for that address, and finally contacting that email
server to verify that the given address exists.
Usage: Text Source
use Mail::CheckUser qw(check_email);
my $ok = check_email($email);
if($ok) {
}
The license for this recipe is available here.
Discussion:
Mail::CheckUser was suggested by Walter Hafner in article 30293638 of comp.lang.perl.misc.
|