Click here to Skip to main content
12,399,799 members (49,509 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET Javascript , +
Hi,

I have to validate the email addresses. For that an email containing verification link is sent to the candidates while registering. By clicking the link the database will be updated with the status of email id as verified. How can I pass the username or other details of the candidates through the verification link?

I am using asp.net with c# coding.

Have any other good methods to implement email verification? Kindly help me....

Thank you.....
Posted 24-Oct-11 19:23pm
Comments
vinodkumarnie 20-Mar-13 8:34am
   
Good Question..
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 4

Hi,

You can send emails by using following code

write below code in button of send verification button
MailMessage mm = new MailMessage();
      mm.To.Add(new MailAddress("yourwebsitemailchecker@gmail.com", "Request for Verification"));
      mm.From = new MailAddress("yourwebsitemailid@gmail.com");
      mm.Body = "<a href="\"http://www.yourwebsitename.com/verificationpage.aspx?custid="+Session">click here to verify</a> fgdfgdfgdfgdfgdfgdfgfdg";
      mm.IsBodyHtml = true;
      mm.Subject = "Verification";
      SmtpClient smcl = new SmtpClient();
      smcl.Host = "smtp.gmail.com";
      smcl.Port = 587;
      smcl.Credentials = new NetworkCredential("yourwebsitemailid@gmail.com", "yourmailpasswrod");
      smcl.EnableSsl = true;
      smcl.Send(mm);

In the above you've to check mail checker in querystring custid

then you can check that yourwebsitemailchecker for inbox with that custid mailid
If it exists means that user verified If not follow one more send verification

I hope you understood what I said

All the Best
  Permalink  
Comments
vinodkumarnie 20-Mar-13 8:35am
   
nice
ADI@345 10-May-14 3:20am
   
i have facing problem using this code,pls help me
Muralikrishna8811 11-May-14 14:08pm
   
post your problm here , we will help you out
ADI@345 10-May-14 3:21am
   
In verificationpage.aspx page contain what????
Muralikrishna8811 11-May-14 14:05pm
   
verificationpage.aspx.cs contains something like this...

if(!IsPostBack){
if(Request.Querystring["custid"]!=null)
{
string customerid=Request.QueryString["custid"].toString();
//do something to very this customer using his id which is coming from querystring

}
}

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

If you are just looking for client side email verification[^] might be a good place for you to start.

http://www.asp.net/security/videos/implement-the-registration-verification-pattern[^] could be useful to you as well.

If you are just looking for email validation, then a simple regex pattern would be sufficient for you to validate the email on the client side - http://msdn.microsoft.com/en-us/library/ff650303.aspx[^].
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

Create a link (absolute production url) of your verification page with QueryString of encrypted UserName, when the user follows the link, decrypt the QueryString inside page_load event of verification page, and verify the user details, you can also put criteria like user must validate the link within an hour or in a day. search codeproject for email sending code if required.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 6

Just generate a unique token (e.g. a GUID), put that in the email, and record it against the user somewhere. When you get a hit on the verification page, check the token that's passed in the query string against the user token for the current session (or, possibly better, look for any users with that verification token and log the current session in as them), and then clear the verified status.

I can't quite remember how ASP.net stores user information but I think you can extend the default user information; this page[^] may be helpful. Alternatively, if custom membership providers look like overkill, create a new table in your database which is for pending verifications, and look up in that instead – but in that case you will have to add a validation check on logging in to check that table, or put users by default into a role called something like PendingVerification which doesn't have access to most of the site.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 20 Mar 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100