Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

VerifyEmailMBS(email as string, NetworkCheck as boolean) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
global method Network MBS Network Plugin 14.0 Yes Yes Yes Yes No
Function: Checks if an email can be valid.
Example:
// should be okay
dim r1 as Integer = VerifyEmailMBS("testing@monkeybreadsoftware.de", true)

// should fail
dim r2 as Integer = VerifyEmailMBS("testing@monkeybreadsoftware.test", true)

MsgBox str(r1)+EndOfLine+str(r2)
Notes:
If NetworkCheck is true, the DNS server is queries for whether an email service is available (MX Record).
Else we only do a syntax check.

Result is zero for scuccess or one of this error codes:
1Invalid character in local part of email address.
2Missing dot in local part of email address.
3Invalid character in local part of email address.
4Unescaped special character in local part of email address.
5No local part in email address.
6Dot found before @ character.
7No domain in email address.
8Domain starting with dot.
9Domain is not allowed to have two dots.
10Invalid character in domain of email address.
11Special character in domain of email address.
12No dot in domain in email address.
13Domain longer than allowed in email address.
14DNS failed to find mail server for the domain in email address. (Windows)
15DNS failed to find mail server for the domain in email address. (Mac/Linux)
16DNS did not find a mail server for the domain in email address.

IDN support is not included. You may need to preprocess email if you need that.

Some examples using this method:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Network Plugin.




Links
MBS Xojo Plugins