[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: check if the email address is valid



shao@cia.com.au (Shao Zhang) wrote:
>	I need to write a program to check if a given email address is
>	valid. I cannot simply send a message to the email address and
>	waiting for a bounce.
>
>	The only way I can think is to telnet to the mail server on port
>	25 and do a VFRY command. However, some mail servers are
>	configured not to allow such command.
>
>	Is there any other way to do this??

I'm afraid the *only* reliable way to check if an e-mail address is
valid is to try to send mail to it. There are simply too many cases.
*Syntactically* valid, yes, you can do that, and even check that the
domain has a mail server sitting on it, although there are many wrong
ways to do it. For a good discussion of this, I strongly recommend
reading the entry in the Perl FAQ on this subject, which you can find by
typing:

  perldoc -q 'valid mail address'

-- 
Colin Watson                                           [cjw44@cam.ac.uk]


Reply to: