Signup · Login
Stardeveloper.com  
Home · Tutorials · Forums · ASP.NET Newsletter Application · Web Hosting Plans · Faisal Khan's Blog · Contact
Search Stardeveloper.com
Newsletter
Enter your email address to receive full length articles at Stardeveloper:


Article Categories
.NET  .NET
  ASP (16)
  ASP.NET (41)
  ADO (16)
  ADO.NET (11)
  COM (6)
  Web Services (4)
  C# (1)
  VB.NET (3)
  IIS (2)

J2EE  J2EE
  JSP (15)
  Servlets (9)
  Web Services (1)
  EJB (4)
  JDBC (4)
  E-Commerce (1)
  J2ME (1)
  Products (1)
  Applets (1)
  Patterns (1)
Log In
UserName Or Email:

Password:

Auto-Login:

Miscellaneous Links
  Submit Article
Stardeveloper RSS Feed
Hosted by Securewebs.com
 
Home : .NET : ASP.NET : Creating an ASP.NET Newsletter Application
 
RSS - Read full length articles at Stardeveloper using Stardeveloper RSS Feed RSS

Creating an ASP.NET Newsletter Application

by Faisal Khan. Follow Faisal Khan on Twitter Follow Faisal Khan on Facebook

Introduction
In this tutorial, we will learn how to create an ASP.NET newsletter application which will allow us to send emails to subscribers of our newsletter. First, we will display a subscription form to the user. Upon entering the email address, we will verify it by sending a validation email. Upon clicking the link in that validation email, the user will be able to validate/confirm his email address and complete the registration process. We will then use a simple online ASP.NET administration interface to create and send newsletters.

New section has been created for Stardeveloper ASP.NET Newsletter Application. You can help support the development of this opensource application by buying the latest version for only $10. The latest version requires ASP.NET 2.0 enabled IIS and SQL Server 2005/2008 database.

Background
At Stardeveloper.com, I had always wanted to have a newsletter to inform the users of new articles and updates. But due to time constraints, I was never able to actually do it. This time though I thought I will develop something really useful which will not only add value to my website but will be equally useful to my readers. I should also acknowledge that I am and will be using this newsletter application at Stardeveloper.com. This is indeed a very solid application.

Copyright & Licensing
I am making the code (v1.0) free for study and use for all non-for-profit organizations and private use. For commercial users and those looking to help support the development of opensource software, I request that they buy a valid license for this Newsletter Application.

Requirements
This newsletter application will make use of ASP.NET 2.0 and SQL Server 2005 Express Edition. It is assumed that you have working installations of Microsoft Visual Web Developer Express Edition, SQL Server 2005 Express Edition and SQL Server Management Studio Express on your computer. We will use the built-in ASP.NET server in Visual Web Developer Express Edition to launch our ASP.NET application. If any of the programs are missing, then please proceed to www.microsoft.com to download and install the necessary applications.

Note: If you have either installed IIS on your computer or have access to it online, then you don't really need Visual Web Developer Express. Likewise, SQL Server Management Studio Express is only required so that you can run the SQL statements that I will provide later to create tables and stored procedures in your SQL Server 2005 database. If you can run the SQL statements by some other method, then SQL Server Management Studio Express is not required.

Application Preview
Please have a look at images below to get a feel for this application. The details of how everything is developed and constructed from plain ground will be discussed later on.

  • Subscription Form: A form that allows users to enter their email addresses and subscribe to our newsletter.

    Newsletter Subscription Form
  • Subscription Form: If the user attempts to enter an invalid email address or if he tries to submit the form without entering any email address, a red asterisk will be shown next to the input field.

    Newsletter Subscription Form - after entry of an invalid email address
  • Subscription Form: When the user enters a valid email address, his email address will be stored in the database and he will be sent a validation email. He will be prompted to check his email and complete the registration by clicking the link in that email.

    Newsletter Subscription Form - after entery of a valid email address
  • Administration Interface: A simple online administration interface allows the admin to create and send emails to subscribers.

    Newsletter Administration Interface

First Step: Creating the Database Backend
The database backend for our newsletter application will consist of 5 tables and 24 stored procedures. The tables diagram is shown below:

Tables Diagram

As the diagram shows, there are 3 important entities in this application:

  1. Subscribers: Represented by the [Subscribers] table, they are actual users who subscribed to our newsletter. It includes all subscribers, validated or questionable (who have not responded to validation emails).

    Note: We only ask and store a subscriber's email address. We do not ask for other things like 'name' or 'address'.

    [Subscribers]
  2. Prepared Emails: They are emails that we create as part of our newsletter to be sent later to the subscribers. We store them in [PreparedEmails] table.

    [PreparedEmails]
  3. Jobs: When we will want to send (prepared) emails to our subscribers, we will create jobs in the [Jobs] table to do the job for us. They will be executed by separate threads which will run in the background. Thus, you can start a job and close your browser and go and do something else. You will not be required to sit in front of your computer. The jobs will run on the ASP.NET server in the background. Different jobs can be run simultaneously. A job is represented by the [Jobs] table. [LoggedMessages] table will keep the log of the messages sent by the thread(s) running the job(s) of the status of the job, like how many emails have been sent and so on. [JobEmails] table contains the list of subscribers to whom this prepared email should be sent as part of this job.

    [Jobs], [JobEmails], and [LoggedMessages] tables

Now that we understand the logical entities that make-up this application and its database backend, we should now move on to create the tables in the SQL Server 2005 database.


 ( 24 Remaining ) Next

Comments/Questions ( Threads: 4, Comments: 9 )
    Contains 1 or more replies by the Author of this Article.
    Contains 1 or more replies by Faisal Khan.

  1. Newsletter Templates? ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  2. Validation Email
  3. Email validation ( 14 Replies ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  4. Server Error in '/news' Application. ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  5. how to create auto task ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  6. Procedure fail? ( 1 Reply ) This thread contains 1 reply by the Author of this Article. This thread contains 1 reply by Faisal Khan.
  7. Sp: AddJob ( 2 Replies ) This thread contains 2 replies by the Author of this Article. This thread contains 2 replies by Faisal Khan.

Post Comments/Questions

In order to post questions/comments, you must be logged-in. If you are not a member yet, then signup, otherwise login. Once you login then come back to this page and you'll see a form right here which will allow you to post comments/questions.

Please note, one of the benefits of signing up is to be notified immediately by email everytime you receive a reply to the thread you have subscribed.

 
© 1999 - 2010 Stardeveloper.com, All Rights Reserved.