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 iOS Targets
global method Network MBS Network Plugin 14.0 ✅ Yes ❌ No ✅ Yes ✅ Yes All
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)

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.
17DNS failed to find mail server for the domain in email address
18DNS server answers try again too often.

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

If you have a DNS server, which will redirect all mistyped domain names to a search website, this won’t really work well and detect too many valid domain names.

Some examples using this global method:

Blog Entries

Xojo Developer Magazine

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


The biggest plugin in space...