Re: [Tutor] Review my code

2011-09-26 Thread Chanakya Mitra
6:42 To: Tutor@python.org Subject: Re: [Tutor] Review my code Chanakya Mitra wrote: > > > I wrote a short script that tries to check if an email address exists or > not. > def mailxch(hname): > mxhosts = DNS.mxlookup(hname) > return mxhosts That can be re-written as:

Re: [Tutor] Review my code

2011-09-26 Thread Steven D'Aprano
Chanakya Mitra wrote: I wrote a short script that tries to check if an email address exists or not. Some brief comments: When you send code by HTML email, you mess up the formatting of the code. Please don't do that in the future. def mailxch(hname): mxhosts = DNS.mxlookup(hname)

[Tutor] Review my code

2011-09-26 Thread Chanakya Mitra
I wrote a short script that tries to check if an email address exists or not. It takes the domain of the inputted email and looks up the registered mail exchange. It then connects via smtp and attempts the "RCPT TO:" command and based on the response decides if the email exists or not.