| Author |
Validating email address!
|
Tulsi Rai
Ranch Hand
Joined: Jun 26, 2002
Posts: 55
|
|
Hi All, does anyone have a good server-side email validation algorithm or codes? i really need help on it. thanks.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
One of the easiest ways to do this (assuming by "email address" you mean an address suitable for SMTP - i.e. RF822) is to use the package InternetAddress in the JavaMail extension - which throws an AddressException if the String does not match RFC822 syntax.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Jessica Sant
Sheriff
Joined: Oct 17, 2001
Posts: 4313
|
|
|
Also, if you're using Struts, you can use their built-in validator which has FieldChecks.validateEmail() -- granted you never call this directly, you set it up through the Struts Validator (it's also credit card, date, url and a variety of primitives and ranges).
|
- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
|
 |
Stefan Wagner
Ranch Hand
Joined: Jun 02, 2003
Posts: 1923
|
|
|
Do you want to check the syntax, whether the email is in use, or whether the email was really send by the person, owning that adress?
|
http://home.arcor.de/hirnstrom/bewerbung
|
 |
 |
|
|
subject: Validating email address!
|
|
|