Validate email address  

Send By: Abu Zant Ruslan
Web : N.A.
Email: N.A.
Date: 05/05/03

Tip accessed 589 times

 


To validate Emails addresses in CGIs...

 procedure TForm1.Button1Click(Sender: TObject);

   function IsEMail(EMail: string): Boolean;
   var
     s: string;
     ETpos: Integer;
   begin
     ETpos := pos('@', EMail);
     if ETpos > 1 then
     begin
       s := copy(EMail, ETpos + 1, Length(EMail));
       if (pos('.', s) > 1) and (pos('.', s) < length(s)) then
         Result := true
       else
         Result := false;
     end
     else
       Result := false;
   end;
 begin
   //Ejemplo de llamada
   //Call example
   if IsEMail('pepe@yahoo.com') then ShowMessage('eMail Ok');
 end;