• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Email validation

 
jasmine dyaga
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Can anyone guide me in writing the code for email validation.
i.e when you register for a site,it should send an email verification to that particular email -id .

Thanks,
Sabitha
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a trivial task.

Accept email address from user.

Assign a unique id (GUID) to that email and store both fields in a database.

Build and Send the validation email (use sendmail api) and in the body put the url to click.
(This would pass the unique id as a parameter to a validation servlet)

Here's the fun part, once they click on the URL, you would need to know the email address of the clicker!
You can ask them to verify and the servlet then matches the passed GUID to the db entry.


Much work needed... but map out the flow first, using simply sequence diagrams or use cases.

WP

 
Tim Moores
Bartender
Posts: 2855
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What William said

An additional concern: The URL should only be valid for a limited time - maybe a few hours, but no more than a day. So the GUID would need to have a timestamp associated with it that indicates its expiration.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic