Validemail is a package for Python that check if an email is valid, properly formatted and really exists.
First, you must do:
pip install validemail
For check the domain mx and verify email exits you must have the dnspython package installed:
pip install dnspython
Basic usage:
from validemail import validemail is_valid = validemail('[email protected]')
Check if the host has SMTP Server:
from validemail import validemail is_valid = validemail('[email protected]',check_mx=True)
Check if the host has SMTP Server and the email really exists:
from validemail import validemail is_valid = validemail('[email protected]',verify=True)