Skip to main content

Email validation

email_validation checks whether an email address can receive mail before you store it. It also flags disposable, free, role and catch-all addresses.

email_validation.pypython
from ideal_postcodes import IdealPostcodes

with IdealPostcodes("ak_test") as client:
email = client.email_validation(query="support@ideal-postcodes.co.uk")
print(email.result, email.deliverable, email.suggestions)

Your key needs email validation enabled.

Result​

result is one of three values:

resultMeaningdeliverable
deliverableThe mailbox accepts mailTrue
not_deliverableMail will bounce, or the domain cannot receive mailFalse
unknownThe API could not check the addressNone

For a deliverable or not_deliverable result, four more flags are True or False:

  • disposable: a throwaway domain, such as temp-mail.org
  • free: a free provider, such as gmail.com or outlook.com
  • role: a role mailbox, such as admin@ or support@
  • catchall: the domain accepts mail for any mailbox, so a deliverable result proves less

For unknown, every flag is None.

Suggested corrections​

Sometimes. When the domain does not resolve or publishes no MX records, suggestions can hold corrected email addresses. The API does not validate them, so check a suggestion before you use it. Every other result returns an empty list.

Cost​

One lookup for a checked address. An unknown result costs nothing, and neither does a domain that does not resolve or has no MX records. The API rejects an address over 320 characters with an APIError.

See email_validation for the parameters.