Gossamer Forum
Home : General : Perl Programming :

Help with E-mail Valid.

Quote Reply
Help with E-mail Valid.
Trying to make a script to validate E-mail address by User, and not by Domain.
I made a script below using Email::Valid to verify addresses but it seems it verifies the address by host name only not by the User Id,

i.e. it gives blahblahblah@yahoo.com is VALID, anyname/ID at Yahoo is given Valid by it. Is there a way that I can modify this script that it check the user/ID first before checking the host, using Email::Valid or any other options will be appreciated.

URL to Email::Valid

http://search.cpan.org/...-Valid-0.15/Valid.pm

--------------------- START of CODE -----------------------------

#!/usr/bin/perl

use CGI;
use Email::Valid;

my $q = new CGI;
print $q->header();

my $e =
"ashdfhsdjhfkjsdhfkjsdhfkj\@yahoo.com";

my $ss = eval { Email::Valid->address($e) };
if ($@) {
# eval failed; Email::Valid probably didn't load
print
"Unknown: $e\n";
}
else {
# Check return from Email::Valid, which is in $ss
if ($ss) {
print
"Valid: $e\n";
}
else {
print
"Invalid: $e\n";
}
}

Quote Reply
Re: [zeshan] Help with E-mail Valid. In reply to
Email::Valid is only designed to check that an email conforms to standards, and in some cases, conforms to the style of specific hosts. The only way to validate an email account is to attempt communication through the account.

Philip
------------------
Limecat is not pleased.