I haven't seen the answer already here among the mess of custom Regex answers, but...
There exists a python library called py3-validate-email validate_email which has 3 levels of email validation, including asking a valid SMTP server if the email address is valid (without sending an email).
To install
python -m pip install py3-validate-email
Basic usage:
from validate_email import validate_email
is_valid = validate_email(email_address='example@example.com', \
check_regex=True, check_mx=True, \
from_address='my@from.addr.ess', helo_host='my.host.name', \
smtp_timeout=10, dns_timeout=10, use_blacklist=True)
For those interested in the dirty details, validate_email.py (source) aims to be faithful to RFC 2822.
All we are really doing is comparing the input string to one
gigantic regular expression. But building that regexp, and
ensuring its correctness, is made much easier by assembling it
from the "tokens" defined by the RFC. Each of these tokens is
tested in the accompanying unit test file.
you may need the pyDNS module for checking SMTP servers
pip install pyDNS
or from Ubuntu
apt-get install python3-dns