codekingpro/portable-devtools
115k
1##########################################################################2#3# pgAdmin 4 - PostgreSQL Tools4#5# Copyright (C) 2013 - 2024, The pgAdmin Development Team6# This software is released under the PostgreSQL Licence7#8##########################################################################9 10from email_validator import validate_email as email_validate, \11 EmailNotValidError12import config13 14 15def validate_email(email):16 try:17 # Validate.18 _ = email_validate(19 email, check_deliverability=config.CHECK_EMAIL_DELIVERABILITY)20 21 # Update with the normalized form.22 return True23 except EmailNotValidError as e:24 # email is not valid, exception message is human-readable25 print(str(e))26 return False27 