Click here to Skip to main content
15,906,574 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: as you see,please tell me why Pin
Robert_Pan3-Jan-10 22:26
Robert_Pan3-Jan-10 22:26 
QuestionChecking e-mail Accounts Pin
inayat basha3-Jan-10 8:00
inayat basha3-Jan-10 8:00 
AnswerRe: Checking e-mail Accounts Pin
JimBob SquarePants3-Jan-10 9:21
JimBob SquarePants3-Jan-10 9:21 
GeneralRe: Checking e-mail Accounts Pin
saini arun3-Jan-10 18:33
saini arun3-Jan-10 18:33 
AnswerRe: Checking e-mail Accounts Pin
saini arun3-Jan-10 18:34
saini arun3-Jan-10 18:34 
AnswerRe: Checking e-mail Accounts Pin
coolestCoder3-Jan-10 20:48
coolestCoder3-Jan-10 20:48 
AnswerRe: Checking e-mail Accounts Pin
David Mujica4-Jan-10 3:23
David Mujica4-Jan-10 3:23 
AnswerRe: Checking e-mail Accounts Pin
April Fans4-Jan-10 16:27
April Fans4-Jan-10 16:27 
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);
}

Function VerifyResultLines($connection,$code)
{
while(($line=$this->GetLine($connection)))
{
if(!strcmp(strtok($line," "),$code))
return(1);
if(strcmp(strtok($line,"-"),$code))
return(0);
}
return(-1);
}

Function ValidateEmailBox($email)
{
if(!$this->ValidateEmailHost($email,&$hosts))
return(0);
if(!strcmp($localhost=$this->localhost,"") && !strcmp($localhost=getenv("SERVER_NAME"),"") && !strcmp($localhost=getenv("HOST"),""))
$localhost="localhost";
if(!strcmp($localuser=$this->localuser,"") && !strcmp($localuser=getenv("USERNAME"),"") && !strcmp($localuser=getenv("USER"),""))
$localuser="root";
for($host=0;$host<count($hosts);$host++)
{
if(($connection=($this->timeout ? fsockopen($hosts[$host],25,&$errno,&$error,$this->timeout) : fsockopen($hosts[$host],25))))
{
if($this->VerifyResultLines($connection,"220")>0 && $this->PutLine($connection,"HELO $localhost") && $this->VerifyResultLines($connection,"250")>0 && $this->PutLine($connection,"MAIL FROM: <$localuser@$localhost>") && $this->VerifyResultLines($connection,"250")>0 && $this->PutLine($connection,"RCPT TO: <$email>") && ($result=$this->VerifyResultLines($connection,"250"))>=0)
{
fclose($connection);
return($result);
}
fclose($connection);
}
}
return(-1);
}
};
April

Comm100 - Leading Live Chat Software Provider


modified 27-May-14 21:46pm.

Questioncreating ajax from C# Pin
Hema Bairavan3-Jan-10 6:23
Hema Bairavan3-Jan-10 6:23 
AnswerRe: creating ajax from C# Pin
N a v a n e e t h3-Jan-10 6:40
N a v a n e e t h3-Jan-10 6:40 
GeneralRe: creating ajax from C# Pin
Hema Bairavan3-Jan-10 17:11
Hema Bairavan3-Jan-10 17:11 
AnswerRe: creating ajax from C# Pin
keyur satyadev3-Jan-10 19:03
keyur satyadev3-Jan-10 19:03 
NewsRe: creating ajax from C# [modified] Pin
Hema Bairavan3-Jan-10 19:58
Hema Bairavan3-Jan-10 19:58 
QuestionQuestion regarding major decline in data retrieval efficiency Pin
James Shao3-Jan-10 2:59
James Shao3-Jan-10 2:59 
AnswerRe: Question regarding major decline in data retrieval efficiency Pin
N a v a n e e t h3-Jan-10 4:46
N a v a n e e t h3-Jan-10 4:46 
GeneralRe: Question regarding major decline in data retrieval efficiency Pin
James Shao3-Jan-10 12:27
James Shao3-Jan-10 12:27 
QuestionUnit testing is a must learn technology for an asp.net programmer? Pin
popchecker2-Jan-10 19:49
popchecker2-Jan-10 19:49 
AnswerRe: Unit testing is a must learn technology for an asp.net programmer? Pin
N a v a n e e t h3-Jan-10 4:57
N a v a n e e t h3-Jan-10 4:57 
GeneralRe: Unit testing is a must learn technology for an asp.net programmer? Pin
popchecker3-Jan-10 17:16
popchecker3-Jan-10 17:16 
GeneralRe: Unit testing is a must learn technology for an asp.net programmer? Pin
N a v a n e e t h3-Jan-10 21:39
N a v a n e e t h3-Jan-10 21:39 
GeneralRe: Unit testing is a must learn technology for an asp.net programmer? Pin
popchecker3-Jan-10 22:43
popchecker3-Jan-10 22:43 
QuestionAjax modal pop up for dynamic control Pin
Hema Bairavan2-Jan-10 18:48
Hema Bairavan2-Jan-10 18:48 
Questionexecuting procedure, Pin
Hema Bairavan2-Jan-10 17:40
Hema Bairavan2-Jan-10 17:40 
AnswerRe: executing procedure, Pin
Brij2-Jan-10 23:04
mentorBrij2-Jan-10 23:04 
GeneralRe: executing procedure, Pin
Hema Bairavan3-Jan-10 2:06
Hema Bairavan3-Jan-10 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.