Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a function to check the validity of an email address given as a parameter. #13

Open
eroesch opened this issue Aug 26, 2017 · 1 comment · May be fixed by #95
Open

Create a function to check the validity of an email address given as a parameter. #13

eroesch opened this issue Aug 26, 2017 · 1 comment · May be fixed by #95

Comments

@eroesch
Copy link

eroesch commented Aug 26, 2017

In a dedicated function, use re.match() to check the validity of a given email address. The function can then be called to test the validity of the FROM parameter, as well as for every addresses extracted from the parameter file. It should use a variant of the following regex (from: https://www.scottbrady91.com/Email-Verification/Python-Email-Verification-Script):

import re

addressToVerify ='[email protected]'
match = re.match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', addressToVerify)

if match == None:
	print('Bad Syntax')
	raise ValueError('Bad Syntax')
@esigalas
Copy link

We are working on it. -Claire -Evangelos, -Markus

@keszybz keszybz added the has-pr label Aug 28, 2017
IreneSophia pushed a commit to IreneSophia/massmail that referenced this issue Sep 3, 2018
Checks with reg expressions whether the emails provided could be real
emails containing an @ and a .
Fixes ASPP#13.
IreneSophia pushed a commit to IreneSophia/massmail that referenced this issue Sep 3, 2018
Adds .com to all the test emails in test_sending.py.
Fixes ASPP#13.
@otizonaizit otizonaizit linked a pull request Apr 16, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants