Checking e-mail Accounts
-
hi all, when i am giving a mail-id in text box it has to check that the mail id is valid or not. Ex:if i give basha@gmail.com then it have to check the mail id is valid in gmail or not. Thanks & Regards, S.Inayat Basha.
-
hi all, when i am giving a mail-id in text box it has to check that the mail id is valid or not. Ex:if i give basha@gmail.com then it have to check the mail id is valid in gmail or not. Thanks & Regards, S.Inayat Basha.
Hi there, Just use a regular expression validator control with the appropriate regex. \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* should do the trick. Cheers
JimBob SquarePants ******************************************************************* "He took everything personally, including our royalties!" David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager *******************************************************************
-
Hi there, Just use a regular expression validator control with the appropriate regex. \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* should do the trick. Cheers
JimBob SquarePants ******************************************************************* "He took everything personally, including our royalties!" David St.Hubbins, Spinal Tap about Ian Faith, their ex-manager *******************************************************************
I think he wants to validate the existence of an email id in gmail. In this case even though the email format is valid but the check can still fail if it does not actually exists under gmail.
-
hi all, when i am giving a mail-id in text box it has to check that the mail id is valid or not. Ex:if i give basha@gmail.com then it have to check the mail id is valid in gmail or not. Thanks & Regards, S.Inayat Basha.
Not very sure but you can check the google APIs for validating an email account. This is only way it can be done.
-
hi all, when i am giving a mail-id in text box it has to check that the mail id is valid or not. Ex:if i give basha@gmail.com then it have to check the mail id is valid in gmail or not. Thanks & Regards, S.Inayat Basha.
-
hi all, when i am giving a mail-id in text box it has to check that the mail id is valid or not. Ex:if i give basha@gmail.com then it have to check the mail id is valid in gmail or not. Thanks & Regards, S.Inayat Basha.
Try something like this ... 1) have the user enter an email account 2) your application generates a link with a random number and sends it to the person for them to click on 3) when the user clicks on this link it will validate that the email account is valid. 4) put an expiration date for the link so that if they don't respond in 3 days the link becomes invalid. Just a thought. david
-
hi all, when i am giving a mail-id in text box it has to check that the mail id is valid or not. Ex:if i give basha@gmail.com then it have to check the mail id is valid in gmail or not. Thanks & Regards, S.Inayat Basha.
Hi, you can use this class: class email_validation_class { //var $email_regular_expression="^([a-z0-9_] |\\- |\\.)+@(([a-z0-9_] |\\-)+\\.)+[a-z]{2,4}$"; var $timeout=0; var $localhost=""; var $localuser=""; Function GetLine($connection) { for($line="";;) { if(feof($connection)) return(0); $line.=fgets($connection,100); $length=strlen($line); if($length>=2 && substr($line,$length-2,2)=="\r\n") return(substr($line,0,$length-2)); } } Function PutLine($connection,$line) { return(fputs($connection,"$line\r\n")); } Function ValidateEmailAddress($email) { //return(eregi($this->email_regular_expression,$email)!=0); return(eregi("^([a-z0-9_] |\\- |\\.)+@(([a-z0-9_] |\\-)+\\.)+[a-z]{2,4}$",$email)!=0); } Function ValidateEmailHost($email,$hosts=0) { if(!$this->ValidateEmailAddress($email)) return(0); $user=strtok($email,"@"); $domain=strtok(""); if(GetMXRR($domain,&$hosts,&$weights)) { $mxhosts=array(); for($host=0;$host<count($hosts);$host++) $mxhosts[$weights[$host]]=$hosts[$host]; KSort($mxhosts); for(Reset($mxhosts),$host=0;$host<count($mxhosts);Next($mxhosts),$host++) $hosts[$host]=$mxhosts[Key($mxhosts)]; } else { $hosts=array(); if(strcmp(@gethostbyname($domain),$domain)!=0) $hosts[]=$domain; } return(count($hosts)!=0);