📧 Email Validation
Validate emails.
A better, simpler way to validate emails with Dymo API in a single line of code!
About Email Validation
What is Email Validation?
Please note that this feature may depend on plugins to function correctly.
Usage
Once we have created and configured our API object, it is quite simple, we just need to execute the following code.
import DymoAPI from "dymo-api";
const dymoClient = new DymoAPI({
apiKey: "PRIVATE_TOKEN_HERE"
});
const decision = await dymoClient.isValidEmail("[email protected]");
import DymoAPI from "dymo-api";
const dymoClient = new DymoAPI({
apiKey: "PRIVATE_TOKEN_HERE",
rules: {
email: {
// These are the default rules defined for email validation.
deny: ["FRAUD", "INVALID", "NO_MX_RECORDS", "NO_REPLY_EMAIL"]
}
}
});
const decision = await dymoClient.isValidEmail("[email protected]");
import DymoAPI from "dymo-api";
const dymoClient = new DymoAPI({
apiKey: "PRIVATE_TOKEN_HERE",
rules: {
email: {
// These are the default rules defined for email validation.
deny: ["FRAUD", "INVALID", "NO_MX_RECORDS", "NO_REPLY_EMAIL"]
}
}
});
// You can overwrite the predefined rules at any time.
const decision = await dymoClient.isValidEmail("[email protected]", { deny: ["NO_REACHABLE"] });
Email Rules
| Rule | Default | Premium | Description |
|---|---|---|---|
FRAUD | ✅ | ❌ | Fraud detection |
INVALID | ✅ | ❌ | Invalid email format |
NO_MX_RECORDS | ✅ | ✅ | MX records check |
PROXIED_EMAIL | ❌ | ❌ | Email using proxy detection |
FREE_SUBDOMAIN | ❌ | ❌ | Email from free subdomain |
PERSONAL_EMAIL | ❌ | ❌ | Personal email vs corporate |
CORPORATE_EMAIL | ❌ | ❌ | Corporate email verification |
NO_REPLY_EMAIL | ✅ | ❌ | Detect no-reply email addresses |
ROLE_ACCOUNT | ❌ | ❌ | Role-based email detection |
NO_GRAVATAR | ❌ | ✅ | Gravatar profile detection |
NO_REACHABLE | ❌ | ✅ | Email unreachable |
HIGH_RISK_SCORE | ❌ | ✅ | High risk score detection |
Response
The more data types you add, the longer the response time will be.
{
email: "[email protected]",
allow: true,
reasons: [],
response: {
valid: true,
fraud: false, // Also for disposable data.
proxiedEmail: false, // Recommendation: Block users who proxy their email.
freeSubdomain: false,
corporate: true,
email: "[email protected]",
realUser: "admin",
didYouMean: null, // Return a possible email you refer to.
noReply: false,
customTLD: false,
domain: "lamoncloa.gob.es",
roleAccount: true,
plugins: {...}
}
}