473,624 Members | 2,444 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating an activation link for an account

I am working on a mailing list service for our company. One of the
requirements is that when a person signs up for a mailing list through the
website they have to activate their subscription through a link sent to them
in an email. How would I do something like this? The db being used is sql
server 2005 express.

Jul 30 '08 #1
3 3148
When the person creates the account, create a GUID for the user. The easiest
way, in SQL Server (Express or otherwise) is to set a column up with
IsRowGuid = true. You will also want a column named IsConfirmed as a bit and
defaulted to 0. Something like:

ALTER TABLE Users
ADD
[ConfirmId] [uniqueidentifie r] ROWGUIDCOL NOT NULL CONSTRAINT
[DF_Users_Confir mId] DEFAULT (newid()),
[IsConfirmed] [bit] NOT NULL CONSTRAINT [DF_Users_IsConf irmed] DEFAULT
((0))
Then send an email with a link like this:
http://www.yourcompany .com/confirm.aspx?id ={the_guid_here }

When they click on the link, you have code that updates IsConfirmed to 1
(true). You then have to alter the logon mechanism to respect that field. If
you are using ASP.NET Membership, create a custom membership provider rather
than whack any bits Microsoft created. As a personal note: There is nothing
more aggrevating, as a consultant, than coming in and finding that the
errors you are experiencing are due to someone whacking standard bits rather
than deriving their own classes. In addition, these whack jobs are rarely
documented, so they can cause great pain to the company when they have to
move the application to another server or get new developers on it years
later.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************** *************** **************
| Think outside the box! |
*************** *************** **************
"Andy B" <a_*****@sbcglo bal.netwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>I am working on a mailing list service for our company. One of the
requirements is that when a person signs up for a mailing list through the
website they have to activate their subscription through a link sent to
them in an email. How would I do something like this? The db being used is
sql server 2005 express.
Jul 30 '08 #2
"Andy B" <a_*****@sbcglo bal.netwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
I am working on a mailing list service for our company. One of the
requirements is that when a person signs up for a mailing list through the
website they have to activate their subscription through a link sent to
them in an email. How would I do something like this? The db being used is
sql server 2005 express.
Several ways, depending on how "secure" this needs to be...

Often, people simply generate a unique identifier based on the email address
to be verified and append that to a URL e.g.

http://www.mywebsite.com/co*********...@sbcglobal.net

As you can see, not particularly secure, since it's perfectly obvious what
the above URL means...

Therefore, the querystring is commonly encrypted in some way (do a Google
for .NET and cryptography for literally thousands of examples of how to do
encryption / decryption with the .NET Framework) e.g.

http://www.mywebsite.com/confirm.asp.../vUEcrD/aNXuj1

Then, when your website receives the above HttpRequest, it simply decrypts
the entire Request.QuerySt ring.ToString() value and looks it up against your
database.

You could further refine this process by rejecting any activation requests
older than a certain amount of time etc...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jul 30 '08 #3
Ill look into it and see how it goes. I wont be using the standard
membership providers for the mailing list service and I am going to be
revamping the website this off season anyways so can make some better
improvements along with another major project I have to do.
"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamMwrote in
message news:OM******** ******@TK2MSFTN GP03.phx.gbl...
When the person creates the account, create a GUID for the user. The
easiest way, in SQL Server (Express or otherwise) is to set a column up
with IsRowGuid = true. You will also want a column named IsConfirmed as a
bit and defaulted to 0. Something like:

ALTER TABLE Users
ADD
[ConfirmId] [uniqueidentifie r] ROWGUIDCOL NOT NULL CONSTRAINT
[DF_Users_Confir mId] DEFAULT (newid()),
[IsConfirmed] [bit] NOT NULL CONSTRAINT [DF_Users_IsConf irmed] DEFAULT
((0))
Then send an email with a link like this:
http://www.yourcompany .com/confirm.aspx?id ={the_guid_here }

When they click on the link, you have code that updates IsConfirmed to 1
(true). You then have to alter the logon mechanism to respect that field.
If you are using ASP.NET Membership, create a custom membership provider
rather than whack any bits Microsoft created. As a personal note: There is
nothing more aggrevating, as a consultant, than coming in and finding that
the errors you are experiencing are due to someone whacking standard bits
rather than deriving their own classes. In addition, these whack jobs are
rarely documented, so they can cause great pain to the company when they
have to move the application to another server or get new developers on it
years later.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss

or just read it:
http://gregorybeamer.spaces.live.com/

*************** *************** **************
| Think outside the box! |
*************** *************** **************
"Andy B" <a_*****@sbcglo bal.netwrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
>>I am working on a mailing list service for our company. One of the
requirement s is that when a person signs up for a mailing list through the
website they have to activate their subscription through a link sent to
them in an email. How would I do something like this? The db being used is
sql server 2005 express.

Jul 30 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8365
by: R. Rajesh Jeba Anbiah | last post by:
I'm supposed to do the account activation via email. I mean *not* sending the activation link like http://foo.com/foo.php?actcode=foo. But, I would like it to be like <actcode>-activation@domain.com or so. I remember, once I did it by checking the POP3 server. Now, I totally forgot how I did it in PHP or server. Also, I couldn't find any solution/script by Googling. Anyone has the idea? TIA. ---
1
2673
by: JaNE | last post by:
Hello, I have made my cms... and is working, but have some, let me say "bugs"... And I don't know all reasons, please allow me slightly longer and most probably confusing post (that "confusing" is mainly becaose of my bad english, and that bad english is also reason why am I learning php that slow...). As first, what is problem: some users after succsesfull registration and login can not see "memeber_menu" and can not activly participate...
0
2706
by: ElGordo | last post by:
I have a routine which opens a command shell and runs an executable. This all worked fine until recently, and I noticed that each time the statement is run, an event is logged in the event viewer stating: ______ The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {CLS-ID} to the user ASPNET SID (ID). This security permission can be modified
0
1394
by: ElGordo | last post by:
I have a .Net application which includes a function to open a command shell and run an executable (for a file extraction program, 7zip). I can run the same exact command line manually with no problems. I noticed that each time the same command line statement is run from the .Net application (always unsuccessfully), an event is logged in the event viewer stating: ______ The machine-default permission settings do not grant Local...
15
2819
by: David Thielen | last post by:
Hi; My ASP.NET app (C# calling J# under .net 2.0) creates a png file in a subdirectory to display as part of the created page. However, the bitmap will not display due to a security violation. Everything is the default settings I believe. IIS is running under Local System. In IIS the DefaultAppPool is running under Network Service. Annonymous access uses the account IUSR_JASMINE (machine name is Jasmine).
3
2151
by: Eric | last post by:
I'm looking for some best practices when it comes time to allowing a user to create an account for our web app. For example, a potential customer of ours would fill out an application and then an email would be sent w/further instructions on how to activate and login to their account. What's the best way to accomplish this? Should our system create a unique password for them (initially) and then require them to create their own? I...
1
3138
by: archana | last post by:
Hi all, I want to develop one web application. What i want is to allow user to create account but at that time before giving rights to that user admin should accept this person's account. So what i want is when user create any account, adming will decide whether to allow user to use site or not by sending mail containing account activation link to user into his mail. Only when user go to that link his account will get activated.
1
2242
by: Andy B | last post by:
I am making a web application that would randomly create an activation code and put it in a database. The web application would then send it in an email to the user with a link to go to and enter the activation code. How would I do this? and what sql server data type would I use? I want the activation code to be no longer than 12 characters, have a mix of numbers and letters and have no special symbols.
5
3226
by: Andy B | last post by:
I am making a web application that would randomly create an activation code and put it in a database. The web application would then send it in an email to the user with a link to go to and enter the activation code. How would I do this? and what sql server data type would I use? I want the activation code to be no longer than 12 characters, have a mix of numbers and letters and have no special symbols.
1
8330
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7153
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4075
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4167
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2603
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1474
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.