This is used to Validating the Email Address
Introduction
IsValidEmailAddress
This is used to Validating the Email Address.
/// <summary>
/// Validating Email Address
/// </summary>
/// <param name="lsEmail"></param>
/// <returns></returns>
public static bool IsValidEmailAddress( string lsEmail )
{
bool lbResult;
int liPosAtChar = -1 , liPosDotChar = -1;
lbResult = Utility.IsValidTextBox( lsEmail );
if ( lbResult )
{
liPosAtChar = lsEmail.IndexOf( "@" );
liPosDotChar = lsEmail.IndexOf( "." );
if ( ( liPosDotChar == 0 ) || ( liPosAtChar == 0 ) )
{ lbResult = false; }
if ( lbResult )
{
if ( liPosDotChar == liPosAtChar + 1 )
{ lbResult = false; }
if ( lbResult )
{
int liposAtcharPlusone = liPosAtChar + 1;
if ( lsEmail.IndexOf( "@" , liposAtcharPlusone ) > 0 )
{
lbResult = false;
}
else
{
lbResult = true;
}
}
}
}
return lbResult;
}