Answers for "how to check if email exists in python"

0

how to check if email exists in python

## Regex ##

def isvalidEmail(email):
    pattern = "^\S+@\S+\.\S+$"
    objs = re.search(pattern, email)
    try:
        if objs.string == email:
            return True
    except:
        return False

VorNotV = isvalidEmail("[email protected]")
print(VorNotV)

####################

## Python Package ##

pip install validate-email-address

pip install py3dns

from validate_email_address import validate_email
isvalid=validate_email('[email protected]')
print(isvalid)

from validate_email_address import validate_email
isExists = validate_email('[email protected]', verify=True)
print(isExists)
Posted by: Guest on April-20-2022

Code answers related to "how to check if email exists in python"

Python Answers by Framework

Browse Popular Code Answers by Language