NetTalk Central

Author Topic: Validating email address  (Read 4734 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Validating email address
« on: September 27, 2013, 11:52:53 AM »
Email is a critical part of our application.   Is there any function that validates an email address?  I have simple tests like includes an @ and has a period after it, but wondered if there was anything more comprehensive.  Even better, a way to confirm the address is actually working.

Any suggestions, greatly appreciated.  Thanks. 

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: Validating email address
« Reply #1 on: September 27, 2013, 09:56:03 PM »
Casey, in a form i set a local variable to loc:eMailFrom (entry field) and in embed point Validate All the following code

X# =  MATCH(UPPER(CLIP(loc:eMailFrom)),|
    '^[-A-Z0-9._]+@{{[-A-Z0-9._]+\.}+[A-Z][A-Z][A-Z]?[A-Z]?$', Match:Regular)

IF X# <> 1             
  loc:invalid = 'loc:eMailFrom'
  p_web.SetValue('retry','EmailFormControl')
  loc:Alert = 'Invalid eMail.'       
ELSE 
!Procedure to send the eMail
  SendEmail(eMailParams)
END!If

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Validating email address
« Reply #2 on: September 29, 2013, 02:40:16 PM »
Thanks, urayoan,  I will give it a shot.

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Validating email address
« Reply #3 on: September 30, 2013, 04:09:38 AM »
Also since String Theory is now required by NTalk you could use it to do the same checking
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186