tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Turner, John" <JTur...@AAS.com>
Subject RE: How to validate email address in JSP by using javax.mail?
Date Wed, 09 Oct 2002 14:03:02 GMT

Typically, there is no way to validate an email address.  For various
reasons, any mail administrator with half a brain turns off the VRFY command
on their mailserver, which is the only 100% guaranteed way to validate an
email address without sending a message and looking for a bounce or other
error.  

Other than that, you can take some precautions on the processing end, like
checking for minimum length, the presence of '@', and a valid MX lookup on
the domain name, and even a valid connection to port 25 of the host listed
in that MX record.  All of that stuff, though, is regular Java, with nothing
to do with javax.mail.

You can always try and send the message, then look for SendFailedException,
but you'd have to do the send first.

John


> -----Original Message-----
> From: Jack Li [mailto:JLi@MurraysDiscount.com]
> Sent: Wednesday, October 09, 2002 9:54 AM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: How to validate email address in JSP by using javax.mail?
> 
> 
> Hi, How to validate email address in JSP by using javax.mail?
> 
>  
> 
> Thanks,
> 
> Jack Li
> 
> 

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message