Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Simple activation email

Simple activation email

Scheduled Pinned Locked Moved ASP.NET
questiondatabaseperformance
11 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    netsooz Amir Hamidi
    wrote on last edited by
    #1

    Hello there I'm having this registration form with 7 fields of real_name, user_name, email, password, city, webpage and signiture, I want my users to fill in this form and then after submitting the form I want to send them an activation email. my database has mentioned fields and also id (using identity) and verfy_user with default value of 0 (which means not). 2 questions are here for me: 1- how can I send activation email (simply?) 2- how can I prevent unactivate users from logging in? your responses will be highly appriciated

    Proper Prepration Prevents Poor Performance! h

    G A 2 Replies Last reply
    0
    • N netsooz Amir Hamidi

      Hello there I'm having this registration form with 7 fields of real_name, user_name, email, password, city, webpage and signiture, I want my users to fill in this form and then after submitting the form I want to send them an activation email. my database has mentioned fields and also id (using identity) and verfy_user with default value of 0 (which means not). 2 questions are here for me: 1- how can I send activation email (simply?) 2- how can I prevent unactivate users from logging in? your responses will be highly appriciated

      Proper Prepration Prevents Poor Performance! h

      G Offline
      G Offline
      Greg Chelstowski
      wrote on last edited by
      #2

      netsooz (Amir Hamidi) wrote:

      1- how can I send activation email (simply?)

      Look up System.Web.Mail or System.Net.Mail. There's loads of Smtp classes in there. And they're fairly simple.

      netsooz (Amir Hamidi) wrote:

      2- how can I prevent unactivate users from logging in?

      Add a bit field in your users table (e.g. IsActive) and set it to true, when the user you're sending an activation email to clicks on the link in that email.

      var question = (_2b || !(_2b));

      1 Reply Last reply
      0
      • N netsooz Amir Hamidi

        Hello there I'm having this registration form with 7 fields of real_name, user_name, email, password, city, webpage and signiture, I want my users to fill in this form and then after submitting the form I want to send them an activation email. my database has mentioned fields and also id (using identity) and verfy_user with default value of 0 (which means not). 2 questions are here for me: 1- how can I send activation email (simply?) 2- how can I prevent unactivate users from logging in? your responses will be highly appriciated

        Proper Prepration Prevents Poor Performance! h

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        1. First user fill the registration form. 2. User Click on the submit button. 3. On submit button click, you send him a activation mail for his account. Now Following is my suggestion for your question.

        netsooz (Amir Hamidi) wrote:

        1- how can I send activation email (simply?)

        Now, I will suggest, add one more filed called GUID in the DB. While sending the mail add the GUID with the corresponding user in the database and send the activation url. Send a URL link with the email like http://yourwebsite.com/Verification.aspx?Guid="AFDFASDFrwerwSDF@423" Now, This GUID will ensure that, weather the user coming from the proper source or not. When user hits the URL, Read the Query String and verify the user GUID from the database. Now if its valid, then set the verfy_user filed to 1 and redirect user to Home Page.

        netsooz (Amir Hamidi) wrote:

        2- how can I prevent unactivate users from logging in?

        During login, Check verfy_user field along with the User ID and Password. If user ID and password matched but verfy_user is still 0, then throw a message that Please activate your account. Hope this will helps you to move ahead. Good luck.

        cheers, Abhijit CodeProject MVP

        J 1 Reply Last reply
        0
        • A Abhijit Jana

          1. First user fill the registration form. 2. User Click on the submit button. 3. On submit button click, you send him a activation mail for his account. Now Following is my suggestion for your question.

          netsooz (Amir Hamidi) wrote:

          1- how can I send activation email (simply?)

          Now, I will suggest, add one more filed called GUID in the DB. While sending the mail add the GUID with the corresponding user in the database and send the activation url. Send a URL link with the email like http://yourwebsite.com/Verification.aspx?Guid="AFDFASDFrwerwSDF@423" Now, This GUID will ensure that, weather the user coming from the proper source or not. When user hits the URL, Read the Query String and verify the user GUID from the database. Now if its valid, then set the verfy_user filed to 1 and redirect user to Home Page.

          netsooz (Amir Hamidi) wrote:

          2- how can I prevent unactivate users from logging in?

          During login, Check verfy_user field along with the User ID and Password. If user ID and password matched but verfy_user is still 0, then throw a message that Please activate your account. Hope this will helps you to move ahead. Good luck.

          cheers, Abhijit CodeProject MVP

          J Offline
          J Offline
          J4amieC
          wrote on last edited by
          #4

          Good answer, but just for the record:

          Abhijit Jana wrote:

          add one more filed called GUID

          filed - as in my glass has been filed with wine [sic] field - as in my database field is "Username" Don't worry though. Most English people get confused with these english words which sound (and often look) the same but have different meanings.

          E A 2 Replies Last reply
          0
          • J J4amieC

            Good answer, but just for the record:

            Abhijit Jana wrote:

            add one more filed called GUID

            filed - as in my glass has been filed with wine [sic] field - as in my database field is "Username" Don't worry though. Most English people get confused with these english words which sound (and often look) the same but have different meanings.

            E Offline
            E Offline
            Expert Coming
            wrote on last edited by
            #5

            Filed actually means like a paper has been filed in a filing cabinet. Filled is filled with wine...

            The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

            J 1 Reply Last reply
            0
            • J J4amieC

              Good answer, but just for the record:

              Abhijit Jana wrote:

              add one more filed called GUID

              filed - as in my glass has been filed with wine [sic] field - as in my database field is "Username" Don't worry though. Most English people get confused with these english words which sound (and often look) the same but have different meanings.

              A Offline
              A Offline
              Abhijit Jana
              wrote on last edited by
              #6

              :( Sorry about that.

              cheers, Abhijit CodeProject MVP

              E J 2 Replies Last reply
              0
              • A Abhijit Jana

                :( Sorry about that.

                cheers, Abhijit CodeProject MVP

                E Offline
                E Offline
                Expert Coming
                wrote on last edited by
                #7

                You simply made a spelling mistake, he even made one :P

                The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

                J 1 Reply Last reply
                0
                • E Expert Coming

                  You simply made a spelling mistake, he even made one :P

                  The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

                  J Offline
                  J Offline
                  J4amieC
                  wrote on last edited by
                  #8

                  Yes, notice I had [sic] after the sentence. I was using filed as it sounds not as its spelt.

                  1 Reply Last reply
                  0
                  • A Abhijit Jana

                    :( Sorry about that.

                    cheers, Abhijit CodeProject MVP

                    J Offline
                    J Offline
                    J4amieC
                    wrote on last edited by
                    #9

                    No need to be sorry Abhijit, you gacve an excellent answer I was just pointing out a possible misunderstanding of the right English word to use... It seems I confused things more using your spelling of filed to mean filled instead of filed. :-D I hate English. I want to speak a cooler, less obtuse, language.

                    A 1 Reply Last reply
                    0
                    • E Expert Coming

                      Filed actually means like a paper has been filed in a filing cabinet. Filled is filled with wine...

                      The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

                      J Offline
                      J Offline
                      J4amieC
                      wrote on last edited by
                      #10

                      Yes, I confused things more. Im a douche.

                      1 Reply Last reply
                      0
                      • J J4amieC

                        No need to be sorry Abhijit, you gacve an excellent answer I was just pointing out a possible misunderstanding of the right English word to use... It seems I confused things more using your spelling of filed to mean filled instead of filed. :-D I hate English. I want to speak a cooler, less obtuse, language.

                        A Offline
                        A Offline
                        Abhijit Jana
                        wrote on last edited by
                        #11

                        :)

                        cheers, Abhijit CodeProject MVP

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups