PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Email address to check
  • Validation by server: Necessary conditions
  • List of TLDs used during a string syntactic validation
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
EmailCheckAddress (Function)
In French: EmailVérifieAdresse
Checks the validity of an email address.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 22 and later
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
New in version 22
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Android Widget This function is now available in Android Widget mode.
Android This function is now available for the Android applications.
Example
EmailCheckAddress("Morgan@test.fr", emailValidateSyntax)
SWITCH EmailCheckAddress("azerty@orange.com")
CASE emailAddressValid
Info("Valid address")
CASE emailAddressIncorrectSyntax
Info("The syntax of the address is incorrect.")
CASE emailAddressRefused
Info("The address was refused by the email server." + ...
"ErrorInfo returns the reason for the refusal.")
CASE emailAddressError
Info("An error occurred during the check. " + ...
"ErrorInfo returns the details of the error.")
OTHER CASE
Info("Undefined case")
END
Syntax
<Result> = EmailCheckAddress(<Address> [, <Validation Level>])
<Result>: Integer constant
Constant used to find out whether the address passed in parameter is valid:
emailAddressErrorAn error occurred during the check. ErrorInfo returns the error details.
emailAddressRefusedThe address was refused by the email server. ErrorInfo returns the reason for the refusal.
emailAddressIncorrectSyntaxThe syntax of the address is incorrect.
emailAddressValidThe address is valid. This address can be used by EmailSendMessage.
Note: A time-out may be required according the response time of the server.
<Address>: Character string (with quotes)
Email address to check.
<Validation Level>: Optional integer constant
Requested type of validation. You have the ability to use one of the following constants:
emailValidateByServerChecks whether the SMTP email server of the domain to which the address belongs accepts the address in input. The syntax of the email address is automatically checked (emailValidateSyntax constant).
AndroidAndroid Widget This constant is not available.
emailValidateSyntax
(Default value)
Checks the syntax of the email address. The TLD (Top Level Domain) is not checked.
emailValidateSyntaxStrictChecks the syntax of the email address as well as the TLD (Top Level Domain) in relation to the list of existing TLDs (see Notes).
Remarks

Email address to check

  • Although the email addresses in "@[domain name].tld" format are valid in relation to the RFC822 standard, they are not accepted by EmailCheckAddress.
  • If the <Validation Level> corresponds to the emailValidateSyntax constant, the email address can contain an empty TLD ("doe@domain." for example).
  • If the <Validation Level> corresponds to the emailValidateByServer or emailValidateSyntaxStrict constant, the email address cannot contain any empty TLD ("vince@domain." for example). In this case, <Result> corresponds to emailAddressIncorrectSyntax.

Validation by server: Necessary conditions

To use the validation by server (emailValidateByServer constant), the application must be able to contact:
  • a DNS server (by UDP on port 53),
  • the email server of the domain to which the address to check belongs (by TCP, port 25).
Therefore, the firewalls may have to be configured specifically.
Caution: In some cases, an email server may accept a non-existing address (when the server is a relay server that cannot access the list of accounts of the domain for which the emails are collected). In this case, <Result> will correspond to the emailAddressValid constant even if the address does not exist. Furthermore, the time for retrieving the sever response can be quite long.
Note: The interrogated SMTP email server is found by the MX record (Mail Exchanger) of the domain of the email address.

List of TLDs used during a string syntactic validation

When performing a strict syntactic check (emailValidateSyntaxStrict constant), a list of international and national TLDs is used.
Versions 20 and later
The list of TLDs was updated with the official IANA list (Internet Assigned Numbers Authority) dated February 2015.
Note: The available TLDs may have changed since this update.
New in version 20
The list of TLDs was updated with the official IANA list (Internet Assigned Numbers Authority) dated February 2015.
Note: The available TLDs may have changed since this update.
The list of TLDs was updated with the official IANA list (Internet Assigned Numbers Authority) dated February 2015.
Note: The available TLDs may have changed since this update.
Versions 22 and later
The list of TLDs was updated with the official IANA list (Internet Assigned Numbers Authority) dated May 2017.
Note: The available TLDs may have changed since this update.
New in version 22
The list of TLDs was updated with the official IANA list (Internet Assigned Numbers Authority) dated May 2017.
Note: The available TLDs may have changed since this update.
The list of TLDs was updated with the official IANA list (Internet Assigned Numbers Authority) dated May 2017.
Note: The available TLDs may have changed since this update.
Related Examples:
WD Mail Complete examples (WINDEV): WD Mail
[ + ] This application is an email client developed in WINDEV. It is based on the Email objects.
This email client is used to retrieve and send emails by using the POP, IMAP and SMTP protocols.
You have the ability to apply filters to the incoming emails.

The application can also be used to manage several email accounts. The writing of an email is based on the HTML edit control.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230com.dll
Windows Mobile wp230com.dll
Java wd230java.jar
Linux wd230com.so
Android wd230android.jar
Minimum required version
  • Version 14
This page is also available for…
Comments
VERIFICANDO EMAIL

EmailCheckAddress(EDT_Email,emailValidateSyntax)
SWITCH EmailCheckAddress(EDT_Email)
CASE emailAddressValid
// Endereço válido
CASE emailAddressIncorrectSyntax
Info("A sintaxe do endereço está incorreta")
CASE emailAddressRefused
Info("O endereço foi recusado pelo servidor de e-mail."+CR+ErrorInfo())
CASE emailAddressError
Info("Ocorreu um erro durante a checagem "+CR+ErrorInfo())
OTHER CASE
Info("Caso indefinido")
END

// BLOG COM VIDEO E EXEMPLO

http://windevdesenvolvimento.blogspot.com/2017/10/aula-1278-email-4-emailcheckaddress.html

https://www.youtube.com/watch?v=yoYq-WYxXgw


De matos
Oct. 31 2017