Monday, December 5, 2011

Python script to check valid email addresses

We were having discussion about checking a list of email addresses for validity.
one of member had posted a bash script for Linux to verify the email addresses before sending the emails.

I thought to write a python script for the same in windows. Well this script can be easily ported to linux with just one or two lines changed. But I was too tired after all day office work to write check for OS and write windows as well as linux code. Currently it is only for gmail domain. But can be easily ported to every domain. Just need to extract domain from email id and check its MX by the existing code. (I told you already I am tired to write more code)
If some people found this useful and need sophisticated version then I would release a next version of program.

This python code take one argument which is list of emails one per line in text format.

You can download python file HERE


VIVL OLO said...

please put it on github

neo said...

Put it on Github, done.

Albert Saini said...

hey neo,
can u plz tell me how this is work...i mean to say how you write this software a paragraph what it exactly do.
does it verify email in a particular domain like u given ''....means it checks the all email in gmail domian ...plz explain a student..

neo said...

If you read the program you would notice it gets the MX server (Mail server from target domain) Then tries to deliver a test email as any normal email would be delivered. If server okays the email id then we are sure that particular id exist on server.
It does not get all email ids on server but it tries to check the email ids from input file given.

Albert Saini said...

this means this program check exit in for jhon1 is really an email id in am right?please answer me..thankyou for reply

klotylda said...

Great explanation, I've been wondering if it works this way for a while now, so thank you. By the way, have your seen - main page already? If not, then you definitely have some updating do to :) It's a brand new email verifying tool which can help you boost your email marketing's performance!