ASP.NET
  Home arrow ASP.NET arrow Creating Your Own Online E-mail System in ...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Creating Your Own Online E-mail System in ASP.NET 2.0
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 22
    2007-06-06

    Table of Contents:
  • Creating Your Own Online E-mail System in ASP.NET 2.0
  • Dissecting the Key Techniques: Interface Design
  • Dissecting the Key Techniques: Sending Email
  • Using SendMail

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating Your Own Online E-mail System in ASP.NET 2.0


    (Page 1 of 4 )

    With network technologies developing rapidly, Internet traffic becomes more smooth and feasible. Today, therefore, more people use various online e-mail systems which greatly facilitate them nearly anywhere in the world. In this article, I will show you a rather complicated sample to explain the key techniques behind building such a system entirely with Microsoft ASP.NET 2.0 plus Microsoft SQL Server Express Edition.
    A downloadable .rar file is available for this article.

    Since the amount of ground to be covered won't all fit in one article, the material will be covered in four parts. This first part will introduce the topic and dissect the key techniques.

    Requirements and Goals

    The online e-mail system to be introduced in this series of articles is actually a common online mailbox, with which you can send various kinds of e-mail, such as e-mail in text format, HTML format, and with attachments. Using the system in this series, you will also be able to manipulate your mailboxes and e-mail, such as by looking up the mailboxes and the e-mail in them.

    Concretely, the main functions enabled by this system can be enumerated as follows:

    • Sending common e-mails
    • Sending HTML-formatted e-mails
    • Sending e-mails with attachments
    • Configuring the mail server
    • Checking your mailboxes
    • Checking the e-mails in your mailboxes
    • Creating, renaming and deleting the folders
    • Reading your e-mails
    • Deleting your e-mails
    • Moving your e-mails

    Does this sound like a very useful and fun project? The next section will show you how to design the underlining part -- the database tier.

    Database Design

    With the general goals in mind, we can now focus upon the database design.

     

    Author's Note: Here you're assumed to be familiar with SQL Server 2005 Express Edition and the basic SQL grammar. In addition, to follow along with the example, you'd better download the source files accompanying this article, available in a link immediately after the introduction.

     

    In this article, we'll design a database named WebMailDatabase.mdf, which contains four tables: Folders for holding mailbox folders, Mails for storing all the e-mails, Attachments for storing all the attachments of the related e-mails, and WebMailProfiles for holding information to configure your mail server. 

    Now, for brevity, the table structures of the four tables are listed in table form respectively as follows:

    Table 1-Structure for Folders Table

    Field name

    Type

    Notes

    FolderID

    int(4)

    Primary Key identifying the record

    Name

    varchar(50)

    The name of the mailbox

    Total

    int(4)

    The number of the e-mails contained in this mailbox

    NoReader

    int(4)

    The number of the unread e-mails

    Contain

    int(4)

    The size of the mailbox

    CreateDate

    datetime(8)

    Tells when the mailbox was created

    Flag

    bit(1)

    Marks whether it's a self-defined mailbox

    Table 2-Structure for Mails Table

    Field name

    Type

    Notes

    MailID

    int(4)

    ID(Primary Key)

    Title

    varchar(255)

    The title of the e-mail

    Body

    text(16)

    The body of the e-mail

    FromAddress

    text(16)

    The sender list of the e-mail

    ToAddress

    text(16)

    The receiver list of the e-mail

    CCAdress

    text(16)

    The CC list of the e-mail

    HTMLFormat

    bit(1)

    Specifies whether it is an HTML-formatted e-mail 

    SenderDate

    datetime(8)

    The send date list of the e-mail

    Contain

    int(4)

    The size of the mailbox

    AttachmentFlag

    bit(1)

    Specifies whether there are attachments in this e-mail

    ReaderFlag

    bit(1)

    Specifies whether this e-mail has been read

    FolderID

    int(4)

    ID of the related mailbox

    Table 3-Structure for Attachments Table

    Field name

    Type

    Notes

    AttachmentID

    int(4)

    ID(Primary Key)

    Name

    varchar(50)

    The name of the attachment

    Url

    varchar(255)

    linking address of the attachment

    Type

    varchar(50)

    Type of attachment

    Contain

    int(4)

    size of the attachment

    MailID

    int(4)

    The ID of its related e-mail

    Table 4-Structure for WebMailProfiles Table

    Field name

    Type

    Notes

    WebMailID

    int(4)

    ID(Primary Key)

    UserName

    varchar(50)

    The user name

    AliasName

    varchar(50)

    The alias name of the user

    Email

    varchar(255)

    The e-mail address of the user

    MailServerIP

    varchar(50)

    The ID address of the mail server

    MailServerPort

    int(4)

    The port of the mail server

    Besides these four tables, we've also defined three stored procedures, namely Pr_DeleteMail, Pr_MoveMail and Pr_SaveAsMail used to delete the e-mails, move the e-mails and save the e-mails sent out, respectively. Here we don't list their relevant sql scripts, since there is still a long journey for us to make. For all detailed information, please refer to the downloadable source files accompanying this article.

    More ASP.NET Articles
    More By Xianzhong Zhu


       · hi, this is really great,but dear friend can u please fwd. me the sql script for...
       · Hi, my friend over there. Don't worry. I'll now email you the sql script as soon as...
       · Hi, when I try to email the whole database to you. I've gotten a 'System Withdraw'...
       · it works fine on local machin but didnt work on severgives error:A...
     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek