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";
}
}

Subject Author Views Date
Thread Help with E-mail Valid. zeshan 3963 Jan 31, 2004, 4:07 PM
Post Re: [zeshan] Help with E-mail Valid.
fuzzy logic 3837 Jan 31, 2004, 4:50 PM