How do you test if an email address is valid

Startbeitrag von Clarion Ghost am 18.07.2012 14:47

I am using a Form to update a data file. How do you test if an email address is valid before saving it? (Using ReturnToCapture(EDT_email_address) would be ideal?

I am looking at IF NOT EmailSendMessage(EmailAccount) THEN

but unless I am mistaken this returns an error only after an attempt to send the mail?

Many Thanks

Antworten:

Hello Ian

There is an EmailCheckAddress() function and also a couple of specific mask options.

Regards
Al

von Al - am 18.07.2012 16:05
If I am understanding this the following Switch Statement recognises as a valid email address because of the format, a @ sign and .com are present. 1getwebwise@aol.com is not a usable email address as it doesn't exist.

Is it possible to detect if an email address is usable not just a valid format?

SWITCH EmailCheckAddress("1getwebwise@aol.com")
CASE emailAddressValid
Info("Valid address")
CASE emailAddressIncorrectSyntax
Info("The syntax of the address is invalid.")
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

von Clarion Ghost - am 18.07.2012 17:28
Check the EmailCheckAddress help for Validation Level in the syntax and in the notes.

It depends a lot on your network configuration and the configuration of the smtp server.

http://doc.windev.com/en-US/?1000017305&name=emailcheckaddress-function

von Paulo Oliveira - am 18.07.2012 17:46
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.