Hello,
I have need help on how to validate the email entered by the user. Am using free form.
with kind regards,
Hello,
I have need help on how to validate the email entered by the user. Am using free form.
with kind regards,
You can try this also. In Itemchanged event
ls_email = Data
Do
ls_object_name = Trim(io_string.of_gettoken (ls_email, ","))
If match(ls_object_name,'^[a-zA-Z0-9][a-zA-Z0-9\-_\.]*\@[a-zA-Z0-9][a-zA-Z0-9\-_\.]*\.[a-zA-Z0-9\-_\.]+[a-zA-Z0-9]+$') = False Then
Messagebox('Error', 'Id : ' + ls_object_name + ' is invalid'
Return False
End If
Loop Until ls_email = ""
This code rejects 1.1..@.
Happiness Always
BKR Sivaprakash
You should code it yourself in PowerBuilder so you can easily update it. The rules are:
General layout:
local-part@domain
Local Part:
Can be up to 64 characters.
Allowed: letters, numbers, underscores, periods, and dashes.
First and last must be letter or number.
Some mail servers may allow other special characters.
Domain:
Can be up to 255 characters.
Allowed: letters, numbers, and dashes.
First and last must be letter or number.
There can only be one dot.
Part before the dot must be at least one character.
Part after the dot must be at least two characters.
You can check the email address to make sure it follows format rules, for example: username@domain.ext
There is no way to verify the email address actually exists and is active.
Mathews,
Just came through this email validations
https://www.atdata.com/email-verification
Seems they have two options. May be helpful
Happiness Always
BKR Sivaprakash
Greetings, Matthews -
I think you need to tread carefully here because of the increased focus and emphasis on privacy and security that many governments are attempting to regulate via legislation. You can parse the email address and verify that it conforms syntactically to specifications, but that does not ensure the email address is valid.
It will be interesting to learn what others in the PB community have done or are doing.
Regards, John
There's a regex at https://emailregex.com/ that works for most addresses and it is very complicated.