• Post Reply Bookmark Topic Watch Topic
  • New Topic

Validating email address!  RSS feed

 
Tulsi Rai
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
does anyone have a good server-side email validation algorithm or codes? i really need help on it. thanks.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!