Registry / serialization / validate-email

validate-email

JSON →
library1.3pypypi✓ verified 24d ago

The `validate-email` library (version 1.3, last updated in 2015) provides basic functionality to verify if an email address is valid, properly formatted, and optionally checks for the existence of its domain's MX record and the email address itself via an SMTP check. Due to its age, it is largely unmaintained. More robust and actively developed alternatives are recommended for modern Python projects.

pip install validate_email
INSTALL
IMPORT
SIG · VALIDATE-EMAIL
V
validate-email
serializationpythonv1.3
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
1/2 runs
1/2 runs
py 3.11
1/2 runs
1/2 runs
py 3.12
1/2 runs
1/2 runs
py 3.13
1/2 runs
1/2 runs
py 3.9
1/2 runs
1/2 runs
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

validate_email
from validate_email import validate_email
from validate_email.validate_email import validate_email
The function is directly exposed at the top level of the package.

Demonstrates basic email validation, including optional MX record and SMTP verification checks. Note that `check_mx` and `verify` require the `pyDNS` dependency to be installed.

from validate_email import validate_email # Basic syntax validation is_valid_syntax = validate_email('test@example.com') print(f"Syntax valid: {is_valid_syntax}") # With MX record check (requires pyDNS) is_valid_mx = validate_email('test@example.com', check_mx=True) print(f"MX valid (requires pyDNS): {is_valid_mx}") # With MX and SMTP verification (requires pyDNS) is_valid_smtp = validate_email('test@example.com', check_mx=True, verify=True) print(f"SMTP verified (requires pyDNS): {is_valid_smtp}") # Example of an invalid email is_invalid = validate_email('invalid-email') print(f"Invalid email: {is_invalid}")
Debug
Known issues
deprecatedThe `validate-email` library (version 1.3) was last updated in 2015 and is largely unmaintained. It may not fully comply with modern RFC standards or integrate well with newer Python versions and asynchronous patterns. Consider using more actively maintained alternatives like `py3-validate-email` or `email-validator` for better support and features.
fix
Migrate to a contemporary and maintained email validation library for improved reliability and future compatibility.
affects: <=1.3
gotchaPerforming real-time MX record lookups (`check_mx=True`) and SMTP server verification (`verify=True`) involves network requests, which are inherently slow and can introduce significant latency to your application. This is often the primary bottleneck when validating many emails.
fix
Minimize calls to network-dependent validation (check_mx, verify). Perform these checks asynchronously or in batch processes, if absolutely necessary, and prefer syntax-only validation for user input in real-time interfaces.
affects: <=1.3
breakingUsing `verify=True` for bulk email verification can lead to your server's IP address being blacklisted by email providers (e.g., Gmail, Outlook). Frequent attempts to connect to SMTP servers for non-delivery purposes can be flagged as spamming activity.
fix
Avoid using `verify=True` for large lists or automated scripts. Reserve it for single, user-initiated validations (e.g., during registration) and ensure your usage adheres to responsible network behavior to prevent IP blacklisting.
affects: <=1.3
gotchaThe `pyDNS` dependency, crucial for MX/SMTP checks, can be problematic to install or use on certain Python 3 environments due to conflicts with other DNS libraries (`dnspython`) or general compatibility issues with older versions of Python 3.
fix
Ensure `pyDNS` is correctly installed. If encountering issues, try `pip uninstall py3dns dnspython` before `pip install pydns` or consider using a different validation library that relies on `dnspython` directly, which is more robust for modern Python.
affects: <=1.3
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'validate_email'
The 'validate-email' library has not been installed in the current Python environment.
fix
Install the library using pip: `pip install validate-email`
ImportError: cannot import name 'validate' from 'validate_email'
The user is attempting to import a function named `validate`, but the primary validation function in this library is named `validate_email`.
fix
Import the correct function: `from validate_email import validate_email`
socket.gaierror: [Errno -2] Name or service not known
The library failed to resolve DNS records (like MX records) for the email's domain during verification, often due to network issues, invalid domain names, or transient DNS problems.
fix
Ensure network connectivity and valid DNS resolution, or disable domain verification by setting `verify=False` and `check_smtp=False` in the function call.
socket.timeout
The SMTP verification step (`check_smtp=True`) timed out while attempting to connect to the mail server, indicating the server was unresponsive or network conditions prevented a timely connection.
fix
Increase the `timeout` parameter or disable the SMTP check entirely by setting `check_smtp=False` if only format validation is required.
Upgrade
Version history
1.3latest on PyPI · released Mar 23, 2015
Audit
Dependencies
pyDNSoptionalRequired for 'check_mx' and 'verify' functionalities (DNS MX record lookups and SMTP checks). Without it, only basic syntax validation is performed.
Agent activity
14 hits · last 30 days
node
10
OpenAI (training)
1
Resources
validate-email — pip install validate-email · libregistry