Skip to content

Instantly share code, notes, and snippets.

Created June 11, 2022 17:13
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Dheirya/7d7214c8449afb366b169a2a1ba4e5e5 to your computer and use it in GitHub Desktop.
Python Spam Email Validator
import urllib.request
def is_disposable_email(email: str) -> bool:
e = email.split('@')[-1]
for ln in urllib.request.urlopen(""):
if ln.decode('utf-8').strip() == e:
return True
return False
print(is_disposable_email("")) # True
print(is_disposable_email("")) # False
print(is_disposable_email("")) # False
print(is_disposable_email("")) # True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment