Posts

Showing posts with the label Check valid Email Address in Delphi

How to check for a valid EMail Address format in Delphi

Now a days most of applications have facility to send Email to Users with some information. So before send Email we generally check for valid Email address format. Here I have 2 approaches how to validate an Email address format in Delphi. 1. Validating Email addresses format using Regular Expression A regular expression is a special text that we can use as a search pattern. So for this we can use a regular expression string to check Email address syntax. And Delphi XE or later versions provide TRegEx class to use regular expression functions. So we can use this approach only on Delphi XE or latter versions. But f or this we have to use  System.RegularExpressions unit in Uses part.  ....     function IsMatch(const Input, Pattern: string): boolean;     function IsValidEmailRegEx(const EmailAddress: string): boolean; .... function TForm1.IsMatch(const Input, Pattern: string): boolean; begin   Result := TRegEx.IsMatch(Input, Pa...