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:
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)
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.