Advertisement
robjones90

Bruno

Dec 11th, 2019
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. from email_validator import validate_email, EmailNotValidError
  2.  
  3.  
  4. #the_list =['robert@robert.com', 'rbrt.jns90@gmail.com']
  5.  
  6. email = "my+address@mydomain.tld"
  7.  
  8. try:
  9.     v = validate_email(email, check_deliverability=True) # validate and get info
  10.     email = v["email"] # replace with normalized form
  11.     print(v)
  12. except EmailNotValidError as e:
  13.     # email is not valid, exception message is human-readable
  14.     print(str(e))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement