Skip to main content

Registration and Email Verification for New Accounts

In This Code i am Providing the code by which the user can easily registered to the Website and the E-Mail is sent to the user for the Verification. If the user will not verify his/her email,the account is not activated and that person cannot login.


Here are the Following Steps to achieve that:-

1.Create new Web application and make one form in which the user can register and add the following code to the source code:

      //Send email to user for verifying account
        CreateUserWizard cuw = (CreateUserWizard)sender;
        MembershipUser user = Membership.GetUser(cuw.UserName);
        Guid userId = (Guid)user.ProviderUserKey;
        System.Net.Mail.MailMessage EmailMsg = new          System.Net.Mail.MailMessage("info@ask.com",            
CreateUserWizard1.Email);
        EmailMsg.Subject = "Email Verification fromhttp:dinesh-itsolutions.blogspot.com/";
        EmailMsg.IsBodyHtml = true;
        EmailMsg.Body = "Thanks for registering with www.http://dinesh-itsolutions.blogspot.com/!<br /><br />Your activation link : <a href=http://http://dinesh-itsolutions.blogspot.com/?ID=" + userId.ToString() + ">Link</a>.";
        System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient();
        //This object stores the authentication values
        System.Net.NetworkCredential basicAuthenticationInfo = new System.Net.NetworkCredential("smtpserverinfo", "smtpserverpassword");

        mailClient.Host = "mail.ask.com";
        mailClient.UseDefaultCredentials = false;
        mailClient.Credentials = basicAuthenticationInfo;
        mailClient.Send(EmailMsg);


2.By the code the email is sent to the user with the unique link.

3.When the user check his/her mail and click on the activate link then it will redirected to the new webpage

now retrieve that unique id from the URL.



4.After Retrieving the Id'...just set the stutus of the Client from 0 to 1 in the database so that the person can login.        


Thank You:

Enjoy ....................n in case if any query then ask me......

Comments

  1. nice work..hey thanx for coding.

    ReplyDelete
  2. This is a nice article..
    Its easy to understand ..
    And this article is using to learn something about it..

    c#, dot.net, php tutorial, Ms sql server

    Thanks a lot..!
    ri70

    ReplyDelete

Post a Comment

Popular posts from this blog

The Page Life Cycle of an ASP.NET and its controls.

The life cycle starts when a user requests a web page through his/her browser. The Web server than process the page through a sequence of steps before response is sent back to the user's browser. The steps are as: Page Request Start Page Initialization Load Validation PostBack Event Handling Render Unload Page Request The page request occurs before the page life cycle begins. When a user requests the page, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page. Start In the start step, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostBack property. Additionally, during the start step, the page's UICulture property is set. Page Initialization During page initialization, controls on ...

Embed Tiny Editor in Your Web Application:

1 . First of all open your Web page in your application in which you want to embed the Editor. 2 . This editor is know as Tiny Editor which has nice features by which the user can enter his/her text in stylish way by embedding smileyes, embed photos. 3 . We can set font family, Font Size, Cut, Copy, Paste and many other functions are there by which the text can be represented in a better way. 4 . Now Steps to embed the Tiny Editor in you web page are: a : Drag and Drop Textbox and give id to id name RichTextBox. b : Set the Property of Textbox:-TextMode Property to Multiline. c : Drop one Label to page, we transfer the text from RichText Box to Label when we store the text to database. d : Put this Code in your Head Tag:   < script type ="text/javascript" src ="tinymce/jscripts/tiny_mce/tiny_mce.js"></ script > < script type ="text/javascript">    tinyMCE.init(     {         mode : "textareas...

Introduction to .NET and .NET Architecture

What is .NET? Microsoft .NET (pronounced “dot net”) is a software component that runs on the Windows operating system. .NET provides tools and libraries that enable developers to create Windows software much faster and easier. .NET benefits end-users by providing applications of higher capability, quality and security. The .NET Framework must be installed on a user’s PC to run .NET applications. This is how Microsoft describes it: “.NET is the Microsoft Web services strategy to connect information, people, systems, and devices through software. Integrated across the Microsoft platform, .NET technology provides the ability to quickly build, deploy, manage, and use connected, security-enhanced solutions with Web services.     What is the .NET architecture? Microsoft .NET consists of four major components: Common Language Specification (CLS) – blue in the diagram below Framework Class Library (FCL) – red Common Language Runtime (CLR) – gr...