Hi,
Is there a Uniface function that checks if a string is a valide email address ?
If not, is there a simple to do it with the match pattern ? We use it to successfully to check if a field is numeric with :
If (MyString != '(-)#*(.)#*') Message/info "Non numeric value",
but I can't find how to ckeck if MyString contains only authorized character with @ in middle and .fr or .com or any other else at the end.
Thanks for adcance.
Laurent.
------------------------------
Laurent Merot
Rocket Forum Shared Account
------------------------------
Hi,
Is there a Uniface function that checks if a string is a valide email address ?
If not, is there a simple to do it with the match pattern ? We use it to successfully to check if a field is numeric with :
If (MyString != '(-)#*(.)#*') Message/info "Non numeric value",
but I can't find how to ckeck if MyString contains only authorized character with @ in middle and .fr or .com or any other else at the end.
Thanks for adcance.
Laurent.
------------------------------
Laurent Merot
Rocket Forum Shared Account
------------------------------
Hi Laurent,
AFAIK a basic eMail address pattern checking requires:
- 1 to N characters
- a mandatory "@"
- 1 to N characters
- a mandatory "."
- 1 to N characters
Probably an acceptable $syntax is:
~@~@*%@~@~@*%.~@~@*
but I am sure someone else will help you with a better solution!
:-) :-) :-)
Regards,
Gianni
------------------------------
Gianni Sandigliano
IT
------------------------------
Hi Laurent,
AFAIK a basic eMail address pattern checking requires:
- 1 to N characters
- a mandatory "@"
- 1 to N characters
- a mandatory "."
- 1 to N characters
Probably an acceptable $syntax is:
~@~@*%@~@~@*%.~@~@*
but I am sure someone else will help you with a better solution!
:-) :-) :-)
Regards,
Gianni
------------------------------
Gianni Sandigliano
IT
------------------------------
Hi Gianni,
It works very well !
And with (-) before or after the @ in this check, we can also authorize draws in the syntax.
Tks a lot, have a good day.
------------------------------
Laurent Merot
Rocket Forum Shared Account
------------------------------
Hi Gianni,
It works very well !
And with (-) before or after the @ in this check, we can also authorize draws in the syntax.
Tks a lot, have a good day.
------------------------------
Laurent Merot
Rocket Forum Shared Account
------------------------------
Hi Laurent,
Happy to have help you!
Anyhow, please consider this further option about eMail address checking:
It's best practice to test deliverability to any email address. This will establish two important things:
- Whether the email box currently exists
- That the user has access to that email box (and is the legitimate user or owner)
If you build email activation processes into your business process, you don't need to worry about other complicated regular expressions that could be found on the internet.
Best Regards,
Gianni
------------------------------
Gianni Sandigliano
IT
------------------------------
Hi Laurent,
Happy to have help you!
Anyhow, please consider this further option about eMail address checking:
It's best practice to test deliverability to any email address. This will establish two important things:
- Whether the email box currently exists
- That the user has access to that email box (and is the legitimate user or owner)
If you build email activation processes into your business process, you don't need to worry about other complicated regular expressions that could be found on the internet.
Best Regards,
Gianni
------------------------------
Gianni Sandigliano
IT
------------------------------
Whilst that is good practice for 'user' interactions, it presumes the person adding the email address is the end client and/or system user. If your staff are adding contacts to a system from an incoming email or telephone call, then the 'two factor' thing above is not likely to be well received by the end client.
You would, however, still want to check the base validity of the email address to help prevent typos.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
Hi,
Is there a Uniface function that checks if a string is a valide email address ?
If not, is there a simple to do it with the match pattern ? We use it to successfully to check if a field is numeric with :
If (MyString != '(-)#*(.)#*') Message/info "Non numeric value",
but I can't find how to ckeck if MyString contains only authorized character with @ in middle and .fr or .com or any other else at the end.
Thanks for adcance.
Laurent.
------------------------------
Laurent Merot
Rocket Forum Shared Account
------------------------------
Hi laurent,
The most correct would be transform in a list before "@" and after "@", there are cases where the e-mail has a dot before de "@".
firstname.lastname@asdfasd.asdfadv_email = $replace("firstname.lastname@asdfasd.asdfad", 1, "@", "+;", -1)
Regards,
Juliano
------------------------------
Juliano Garcia
Suport Analyst
Coamo -Coop. Agropecuaria Mouraoense
Campo Mourão BR
------------------------------
Hi laurent,
The most correct would be transform in a list before "@" and after "@", there are cases where the e-mail has a dot before de "@".
firstname.lastname@asdfasd.asdfad
v_email = $replace("firstname.lastname@asdfasd.asdfad", 1, "@", "+;", -1)
Regards,
Juliano
------------------------------
Juliano Garcia
Suport Analyst
Coamo -Coop. Agropecuaria Mouraoense
Campo Mourão BR
------------------------------
Hi Juliano,
I've modified the test to authorize dot (.) and draw (-) before and after the @, and draw (-) after the @ :
If (MyMail != '~@~@*(-)~@*(.)~@*(-)~@*%@~@~@*(-)~@*%.~@~@*)
RES= "Not OK"
Else
RES="OK"
EndIf
I've then just to control the length of the address. It won't be the guarantee of an exiting and valid e-mail address but my users are not end-user and I can't test the deliverability to any email address as suggests Gianni.
Regards,
Laurent
------------------------------
Laurent Merot
Rocket Forum Shared Account
------------------------------