From e75cfe50671eb8d1df41351235966ddee71b3fea Mon Sep 17 00:00:00 2001 From: root Date: Mon, 3 Oct 2022 11:36:51 +0000 Subject: [PATCH] Added email-validator script --- scripts/Email Validator/README.md | 13 +++++++++++ scripts/Email Validator/email_validator.py | 27 ++++++++++++++++++++++ scripts/Email Validator/requirements.txt | 3 +++ 3 files changed, 43 insertions(+) create mode 100644 scripts/Email Validator/README.md create mode 100644 scripts/Email Validator/email_validator.py create mode 100644 scripts/Email Validator/requirements.txt diff --git a/scripts/Email Validator/README.md b/scripts/Email Validator/README.md new file mode 100644 index 0000000..3615556 --- /dev/null +++ b/scripts/Email Validator/README.md @@ -0,0 +1,13 @@ +# Email Validator with Python + +This is a script that takes input as an email address and checks whether the email address is valid or not. It contains checking static email address format as well as smtp server checking for better validation. + + +### Usage + - Install the requirements (refer below) + - Run the script by 'python email_validator.py' + - Input the email address to be validated when prompted + + +### Requirements +```pip install py3dns, pyfiglet, validate-email-address``` diff --git a/scripts/Email Validator/email_validator.py b/scripts/Email Validator/email_validator.py new file mode 100644 index 0000000..b8e6fca --- /dev/null +++ b/scripts/Email Validator/email_validator.py @@ -0,0 +1,27 @@ +''' +Author: smit-sms +'pip install py3dns,pyfiglet,validate-email-address' to get required libraries + +USAGE + - Run the script by 'python email_validator.py' + - Input the email address to be validated when prompted +''' + + +import pyfiglet +from validate_email_address import validate_email + +# printing the ascii banner +print(pyfiglet.figlet_format(" Email Validator")) + +print('-' * 72) +email_id = input("Enter email address to be validated: ") +print('-' * 72) + +# Verifying the email id with the smtp server to check validity +isvalid = validate_email(email_id, verify=True) + +if isvalid: + print("\n\nThe following email address is Valid.\n") +else: + print("\n\nThe following email address is Invalid.\n") diff --git a/scripts/Email Validator/requirements.txt b/scripts/Email Validator/requirements.txt new file mode 100644 index 0000000..a3d7b07 --- /dev/null +++ b/scripts/Email Validator/requirements.txt @@ -0,0 +1,3 @@ +py3dns +pyfiglet +validate-email-address \ No newline at end of file