Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advanced e-mail validation?

Status
Not open for further replies.

c4n

Programmer
Mar 12, 2002
110
SI
In my CGI scripts I validate u-mail so that I check for a dot "." and a "@". Like this:

unless ($email=~/\@/ && $email=~/\./) {
&error;
exit;
};

The problem is people can still enter a not-working e-mail (like this one: asfaasd@asdasf.com) but the script will not detect this.

Is there a way to ... hmmm ... "make" the MAIL PROGRAM check if this e-mail is actually working?

I'm using Sendmail and tried with some switches but allways get that lovely "500 Internal server error" message.

Here is a link to Sendmail switches (a very useful resource):


The -bt and -bv are used for e-mail validation but like said, I hadn't had any luck yet.

Can anyone help me out? Perhaps you have some other ideas or tricks for "advanced" e-mail validation?

A HUGE thanks in advance!
 
#!perl -W
use Mail::CheckUser qw(check_email);

my $email = "someone\@somewhere.com";

if(check_email($email)) {
print &quot;E-mail address <&quot; . $email . &quot;> is OK&quot;;
} else {
print &quot;E-mail address <&quot; . $email . &quot;> isn't valid&quot;;
}

exit;
# example with : Mail::CheckUser 1.02 ---------------------------------------
wmail.jpg


someone knowledge ends where
someone else knowledge starts
 
A second possibility is to mail them a random password or access key to the provided email. Then have them send it back to you and continue process the rest of the program when the passkey is supplied.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top