sdyates has asked for the wisdom of the Perl Monks concerning the following question:
The code below is not very good, dispite several hours of work. eee@eee.com is ok. It does fail on addresses where there is no valid domain, but my code does not determine if the user account is valid. Before I continue to rack my brains, can I actually determine if a given email address is valid? Can Email::Valid or any other module actually call the mx daemon at ee.com to see if the given account, eee, is valid?
I continue to look, but am beginning to realise the best way is to talk directly to the smtp port directly, but I fear the code could develope into a nightmare...I sense this is really easy and I am just missing the point. Can someone hit me with a 2x4?
Please advise,
Simon
if($EmailAddress) { eval { if (my $addr = Email::Valid->address( -address => $EmailAd +dress, function start() { document.forms[0].elements[0].focus(); } </SCRIPT> </HEAD> <body bgcolor='ffffcc' onLoad='start()'> "; generate_form(); my $EmailAddress = $cgi->param('EmailAddress'); if($EmailAddress) { eval { if (my $addr = Email::Valid->address( -address => $EmailAd +dress, -mxcheck => 1, -fudge => 1 )) { print "$addr OK\n"; } else { print "$addr failed $Email::Valid::Details check.\n"; } }; warn "an error was encountered: $@" if $@; } print end_html();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Determining a valid address
by Juerd (Abbot) on Apr 02, 2002 at 22:00 UTC | |
by sdyates (Scribe) on Apr 02, 2002 at 22:49 UTC | |
|
Re: Determining a valid address
by gav^ (Curate) on Apr 02, 2002 at 21:51 UTC | |
|
Re: Determining a valid address
by blackflag (Novice) on Apr 02, 2002 at 21:59 UTC |