Sie sind auf Seite 1von 78

PROJECT REPORT

ON
INTRALINK
THE LAN BASED MAILING SERVICE

Submitted in partial fulfillment of the requirements


for the award of the degree of

Bachelor of Technology

In
Infor mation Technology

Guide: Ms. ANJU SAHA Submitted by:

VAIBHAV TYAGI

Roll no: 0861641505

University School of Information Technology


GGS Indraprastha University, Delhi - 6

(2005-2009)
CERTIFICATE

This is to certify that VAIBHAV TYAGI, Roll No. 0861641505 ,Sem-VIII of University

School Of Information Technology(USIT) has submitted the Project Report on “Intralink

LAN Based Mailing Service” in the partial fulfillment of the requirement for award of

Degree in B.TECH(IT) under my Guidance.

The work is original and it has not been submitted earlier either in part or in full for any

purpose.

DATED:

Ms.Anju Saha

Sr. Lecturer

USIT,

G.G.S. I.P.U,

Kashmere Gate, Delhi-110006


CERTIFICATE

This is to certify that VAIBHAV TYAGI, Roll No. 0861641505 ,Sem-VIII of University

School Of Information Technology(USIT) has submitted the Project Report on “Intralink

LAN Based Mailing Service” in the partial fulfillment of the requirement for award of

Degree in B.TECH(IT) under my Guidance.

The work is original and it has not been submitted earlier either in part or in full for any

purpose.

DATED:
Mr Sanjay Pal

Additional Director

RAC, DRDO

Ministry of Defence

Lucknow Road, Timarpur

Delhi 110 054


ACKNOWLEDGEMENT

I feel pride in placing on record our deep gratitude to our honourable guide Ms. Anju Saha

who despite her extremely tight and busy time schedule spared enough quality time to

guide me throughout the journey of this project. Whether it was removing bugs from the

programs or clearing our doubts, She helped me in solving all the problems with

comfortable ease. She also encouraged and motivated me to sail through in difficult times.

It is hard to imagine successful completion of such a project without her able guidance ,

care and inspiration.

The task is major and so is the contribution of friends, family members and teachers. People

are my own and with a great sense of modesty, they prefer their names not to be written

individually in the expression of gratitude, in this brief space.

My sincere thanks to one and all, associated with this project directly or indirectly at any

point of time.

Vaibhav Tyagi

B.Tech(IT)

Roll No. 0861641505


ACKNOWLEDGEMENT

I feel pride in placing on record our deep gratitude to our honourable guide Mr. Sanjay Pal

who despite his extremely tight and busy time schedule spared enough quality time to

guide me throughout the journey of this project. Whether it was removing bugs from the

programs or clearing our doubts, he helped me in solving all the problems with comfortable

ease. She also encouraged and motivated me to sail through in difficult times. It is hard to

imagine successful completion of such a project without her able guidance , care and

inspiration. We are grateful to Ms. Anju Saha for her helping hand and sparing her valuable

time. Their painstaking and timely guidance evokes in us natural good feelings and

gratitude towards them.

The task is major and so is the contribution of friends, family members and teachers. People

are my own and with a great sense of modesty, they prefer their names not to be written

individually in the expression of gratitude, in this brief space.

My sincere thanks to one and all, associated with this project directly or indirectly at any

point of time.

Vaibhav Tyagi

B.Tech(IT)

Roll No. 0861641505


ABSTRACT

In the modern times everything is jet fast. This all can be attributed to fast communication.

The dynamic nature of the world emphasizes this need strongly. Electronic Mail is one such

medium, which provides fast and cheap communication. An email can be received in any

part of the world immediately or with in a few minutes.

The purpose of this project is to provide a platform where the employees of an organization

can exchange mails and files on a particular LAN. A user’s mails will be stored on the server

and they will be stay there until he/she deletes them explicitly. User also has the functionality

of sending mails originating from his account. He/she can choose to compose a new message

or reply to a received message or even forward a mail as it is.

The user is assigned three folders INBOX, SENT and ADRESS BOOK.

All the messages intended for the user are stored in the folder INBOX.

All the messages sent by the user are stored in the SENT folder.

The user can maintain an ADDRESS BOOK which contains the contacts of all other users

on the system that the user needs to communicate with. The user can also search for the

record of a particular contact in the address book if and when he desires to.

The user can also view his/her profile and customize the session pages through the

functionality provided by MY SETTINGS.

Design wise, the application is divided in two components: the Internal component and the

User Interface component. The internal component consists of a thread daemon, which

fetches the mails intended for the user from the server and stores it in a database.

The User Interface component consists of the functionality of features like composing a

mail, reading mails from the inbox, viewing the mails sent, adding and retrieving contacts
provided to the end user. This component is developed using Java Servlets, Java Server

Pages and Hyper Text Markup Language. The data required for the servlets is fetched from

the Database in Microsoft Access, which is assumed to be updated by the daemon as per the

user requests. The two components work independent of each other. The only common thing

between them is the database and the connectivity between them is provided using the Java

Data Base Connectivity(JDBC).


CONTENTS

1. INTRODUCTION……………………………………………………….1

Aim………………………………………….………………………………..1

Intralink at a glance………………………………………….……………….1

Objective…………………………………………….……………………….2

Purpose………………………………………………..……………………...2

Scope……………………………………………………..…………………..3

Functions………………………………………………..…………………....3

Key Features……………………………………………..…………………..4

2. SYSTEM ANALYSIS…………………………………………………..7

Identification of Need……………………………………………………….7

Preliminary Investigation……………………………………………………7

3. REQUIREMENTS……………………………………………………..10

Hardware Requirements……………………………………………………10

Software Requirements…………………………………………………….10

4. TECHNOLOGIES USED………………………………….…………11

Web Server………………………………………………….………….….11

Mail Server………………………………………………………..……….11

Front End and Back End……………………………………………….…11

Mailing Mechanism…………………………………………..…………...13
Protocols Used…………………………………………………….……..14

The Core Classes……………………………………………..…………..16

Using the Java Mail API…………………………………….…………...22

5. DESIGN………………………………………...…………………...28

Data Flow Diagrams……………………………………………………..28

Use Case Diagram……………………………………………………….31

Sequence Diagrams………………………………...……………………33

6. DATABASE DESIGN…………………….……………………….36

7. SCREENSHOTS……………………………………………..……..40

User End………………………………………………………..……….40

Admin End……………………………………………………...……….62

8. FUTURE SCOPE……………………………………...……...…….67

9. BIBLIOGRAPHY and REFERENCES…………………………...68

10. CONCLUSION………………………………………….....………69
INTRODUCTION

1.1 AIM

The aim of this project is to provide a LAN based mailing service that connects

various users on the system. The system has all the basic features of a standard

mailing system like composing mails, reading mails, viewing the sent mails, adding or

retrieving contacts. It should also provide the feature of user customization wherein

the user can change the appearance of his session pages. The project should also

provide an administrator interface through which the administrator can access and

control the system , that is the activation, deactivation and deletion of accounts, the

facility of taking the database backup. The project also enables the administrator to

change his/her password if and when desired.

1.2 INTRALINK AT A GLANCE

The purpose of this project is to provide a platform where the employees of an

organization can exchange mails and files on a particular LAN. A user’s mails will be

stored on the server and they will be stay there until he/she deletes them explicitly.

User also has the functionality of sending mails originating from his account. He/she

can choose to compose a new message or reply to a received message or even forward

a mail as it is.

Design wise, the application is divided in two components: the Internal component

and the User Interface component. The internal component consists of a thread

-1-
daemon, which fetches the mails intended for the user from the server and stores it in a

database.

The User Interface component consists of the functionality of features like composing

a mail, reading mails from the inbox, viewing the mails sent, adding and retrieving

contacts provided to the end user. This component is developed using Java Servlets,

Java Server Pages and Hyper Text Markup Language. The data required for the

servlets is fetched from the Database in Microsoft Access, which is assumed to be

updated by the daemon as per the user requests. The two components work

independent of each other. The only common thing between them is the database and

the connectivity between them is provided using the Java Data Base

Connectivity(JDBC).

1.3 OBJECTIVE

1.3.1 Purpose

The entity is implemented using Servlets, the user submits his requests and the output

is presented to the user in the formatted way after querying the server.

The user can read his messages, reply to them, forward these messages or delete them.

There are options for changing the password of the administrator.

There are different servlets that implement different functions. These servlets are

called by the main servlet as and when required.

-2-
All the information regarding the user and his messages in different folders are stored

in a database (MS-Access) and the servlets interface the database using the database

bridge (Jdbc-Odbc Bridge).

1.3.2 Scope

The software products produced are a host DBMS and a website. The DBMS will

maintain the records of all the users at a given time that are activated on the system by

the administrator, that is all the users who are authorized to send/receive messages on

the system. The database also keeps a track of all the messages sent on the system

along with the time of sending the mail. Along with that, the records of the contacts

added by the user are also stored in the database and of course, the user customization

information, which directs the system to use a particular selection for a given user.

The system will be used by a variety of people, of different age group, demographics,

and varied interests given that they belong to the same organization.

The goal of the software is to allow dynamic content maintenance and updation and

also session management during the sending or receiving of a particular mail for a

given user.

1.3.3 Functions

The system provides the following functionalities:

 Composing a Mail:
The user can compose a mail and send it to all the recipients he wishes to

send to. The user can also attach a file along with the message as per the

requirement.

-3-
 Reading a Mail:

The user can read a particular mail by clicking on the subject of the mail

displayed in the inbox.

 Replying to a Mail:

The user can choose to reply to a particular mail after viewing it. When he

selects this option the email ID of the recipient is entered automatically in

‘To’ field. Rest of the functionality is the same as in Composing a mail.

 Deleting a Mail:

The user can delete a particular mail or a list of mails to avoid cluttering of

space in the mailbox and from the mail server.

1.3.4 Key Features

 Check Mail:

The user can check the incoming mails in the INBOX..

 Reply to a Mail:

The user can choose to reply to a particular mail after reading it. Selecting

this option, the user can send the information he wants to convey with or

without the message received

-4-
 Deleting a Mail:

The system provides the user with the functionality of deleting any number

of mails present in his/her inbox. The mails once deleted cannot be

retrieved once they have been deleted that is, they are deleted permanently.

 Composing Mail:

The user can compose a mail and send it to all the people he wishes to send

them to.

 Attaching a file:

The system enables the user to attach a file(which can be a document or a

picture or anything that can be sent) along with the text message being

sent.

 Sent Mail:

The mails sent by the user can be viewed in the Sent mail folder. The user

can check the mails when he wants to see the old mails sent by him.

 Address Book:

The system allows the user to maintain an Address Book which holds the

details of the contacts required by the user.

-5-
 Searching in the Address Book:

A user can search for the information of a particular contact in his/her

Address Book using the search string.

 View Self Profile:

The user can view the details of his/her account using this option.

 User Customization:

The system also provides the end user with the functionality of changing

the background themes for the session pages of his/her account.

-6-
SYSTEM ANALYSIS

2.1 IDENTIFICATION of NEED

This step is initiation of System Analysis. An overview of the project’s requirement

has been done. The basic need of the client to opt for such kind of project is analyzed.

The purpose of this project is to provide this Email facility to common man, free of

cost. All user’s mails will be stored on the server and they will be there until he deletes

them .

The Manual Process of mailing, which is not at all compatible with current working

conditions of users. It was not only time consuming, but also lacks accuracy. Security

point of view the manual system was failed to hide the information from any

unauthenticated person. Therefore, there is requirement of such Computerized

System, which can full fill all of the current as well as future mailing requirements.

2.2 PRELIMINARY INVESTIGATION

The client is a user in an organization who wants to open an email account . He should

be provided with all the basic facilities for mailing and some other perks like address

book, sent mail folder etc.

Administrator has authority to the check the status of any user at any time.

Administrator can Activate or De-Activate the user account on the basis of certain

criteria.

-7-
Different Modules In Computerized System:

Module 1. Account Creation:

The system provides facility to open new accounts.

Module 2: Authentication:

Authentication is an important procedure which must be performed before any

user have an access to the system. There are two types of users namely:

• ADMINISTRATOR

• USER

Module 3: Administartor module

Administrator has the privilege to Activate or De-Activate the user account on the

basis of certain criteria. He can also have a look at the original MS-Access

database.

Module 4: Compose mail Module

In this module, the user has been given the facility to compose a mail and sent it to

all other user he wants one by one. The user can attach any file along with message

if he wants.

-8-
Module 5: Sent mail Module

In this module, the mails sent by the user are saved in Sent mail folder. He/She can

have a look on these mails whenever he/she wants to.

Module 6: Address Book Module

In this module the user is allowed to maintain an Address Book which will have all

the contacts the user requires.

Module 7: User Customization Module

This module helps the user to customize his/her account wherein he/she can change

the appearance of his/her session pages.

-9-
REQUIREMENTS

3.1 HARDWARE REQUIREMENTS


Hardware is the term given to machinery itself and to various individual pieces of

equipment.

It refers to the physical devices of a computer system. Thus the input, storage,

processing control and output devices are hardware.

Minimum Hardware Requirement Of Client Side:

o Processor: Any Pentium or Equivalent Machine

o RAM: minimum of 128 MB

o HDD: 4 GB or higher

o 14 inch Color Monitor

3.2 SOFTWARE REQUIREMENTS

Software means a collection of program where the objective is to enhance the

capabilities of the hardware machine.

Minimum Software Requirement Of Client Side:

o Operating System : Windows 98/2000/XP/NT

o Database : MS-ACCESS

- 10 -
TECHNOLOGIES USED

4.1 WEB SERVER


The web server used in the project is Apache Tomcat (ver 5.5). Apache Tomcat is the

servlet container that is used in the official Reference Implementation for the Java

Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages

specifications are developed by Sun under the Java Community Process. Apache

Tomcat is developed in an open and participatory environment and released under the

Apache Software License. Apache Tomcat is intended to be a collaboration of the

best-of-breed developers from around the world. We invite you to participate in this

open development project.

4.2 MAIL SERVER

The mail server used in the project is SurgeMail. It provides the basic functionalities

of a standard mail server like making new users accounts, deleting user accounts,

holding an inbox for every user etc. instead of SurgeMail any of the mail servers

available can be used.

4.3 FRONT END and BACK END

The front end of the project is made with the help of Java Server Pages(JSP),

Hypertext Markup Language(HTML) and JavaScript.

- 11 -
Java Server Pages (JSP) technology enables Web developers and designers to

rapidly develop and easily maintain, information-rich, dynamic Web pages that

leverage existing business systems. As part of the Java technology family, JSP

technology enables rapid development of Web-based applications that are platform

independent. JSP technology separates the user interface from content generation,

enabling designers to change the overall page layout without altering the underlying

dynamic content.

Benefits of using JSP:

o Use JSP technology without having to learn the Java language: You can

use JSP technology without learning how to write Java scriplets. Although

scriptlets are no longer required to generate dynamic content, they are still

supported to provide backward compatibility.

o Extend the JSP language: Java tag library developers and designers can

extend the JSP language with "simple tag handlers," which utilize a new, much

simpler and cleaner, tag extension API. This spurs the growing number of

pluggable, reusable tag libraries available, which in turn reduces the amount of

code needed to write powerful Web applications.

o Easily write and maintain pages: The JavaServer Pages Standard Tag

Library (JSTL) expression language is now integrated into JSP technology and

has been upgraded to support functions. The expression language can now be

used instead of scriptlet expressions.

- 12 -
JavaScript is used in millions of Web pages to improve the design, validate forms,

detect browsers, create cookies, and much more. JavaScript is the most popular

scripting language on the internet, and works in all major browsers, such as Internet

Explorer, Mozilla, Firefox, Netscape, and Opera. JavaScript was designed to add

interactivity to HTML pages. It is a lightweight programming language. It is usually

embedded direct into the HTML pages. It is an interpreted language that is scripts

execute without preliminary compilation. Everyone can use it without purchasing a

license.

HTML stands for Hyper Text Markup Language. An HTML file is a text file

containing small markup tags. The markup tags tell the Web browser how to display

the page. An HTML file must have an htm or html file extension. An HTML file can

be created using a simple text editor.

Back End used here is MS-Access. All the data base tables related to the project are

made in MS-Acess.

4.4 MAILING MECHANISM

Java Mail API is used for the internal mechanism for storing and transporting of mails.

Following is the brief description of Java Mail API:

The JavaMail API is an optional package (standard extension) for reading, composing,

and sending electronic messages. The package is used to create Mail User Agent

(MUA) type programs, similar to Eudora, Pine, and Microsoft Outlook. Its main

- 13 -
purpose is not for transporting, delivering, and forwarding messages like sendmail or

other Mail Transfer Agent (MTA) type programs. In other words, users interact with

MUA-type programs to read and write emails. MUAs rely on MTAs to handle the

actual delivery.

The JavaMail API is designed to provide protocol-independent access for sending and

receiving messages by dividing the API into two parts:

The first part of the API deals with, how to send and receive messages independent of

the provider/protocol.

The second part speaks the protocol-specific languages, like SMTP, POP, IMAP, and

NNTP. With the JavaMail API, in order to communicate with a server, we need a

provider for a protocol.

4.4.1 Protocols Used

 SMTP:

The Simple Mail Transfer Protocol (SMTP) is the mechanism for delivery

of email. The JavaMail-based program will communicate with own

company or Internet Service Provider's (ISP's) SMTP server. That SMTP

server will relay the message on to the SMTP server of the recipient(s) to

eventually be acquired by the user(s) through POP or IMAP. This does not

require the SMTP server to be an open relay, as authentication is

supported, but it is our responsibility to ensure the SMTP server is

- 14 -
configured properly. There is nothing in the JavaMail API for tasks like

configuring a server to relay messages or to add and remove email

accounts.

 POP

POP stands for Post Office Protocol. Currently in version 3, also known as

POP3. POP is the mechanism most people on the Internet use to get their

mail. It defines support for a single mailbox for each user. That is all it

does, and that is also the source of most confusion. Much of what people

are familiar with when using POP, like the ability to see how many new

mail messages they have, are not supported by POP at all. These

capabilities are built into programs like Eudora or Microsoft Outlook,

which remember things like the last mail received and calculate how many

are new for you. So, when using the JavaMail API, if you want this type of

information, you have to calculate it yourself.

 MIME

MIME stands for Multipurpose Internet Mail Extensions. It is not a mail

transfer protocol. Instead, it defines the content of what is transferred: the

format of the messages, attachments, and so on.

- 15 -
4.4.2 The Core Classes

The core classes that make up the API are: Session, Message, Address,

Authenticator, Transport, Store, and Folder. All these classes are found in the

top-level package for the JavaMail API: javax.mail.

i) Session

The Session class defines a basic mail session. It is through this session that

everything else works. The Session object takes advantage of a

java.util.Properties object to get information like mail server, username,

password, and other information that can be shared across your entire application.

The constructors for the class are private. We can get a single default session that can

be shared with the getDefaultInstance() method or we can create a unique session

with getInstance().

In most cases, it is sufficient to use the shared session, even if working with mail

sessions for multiple user mailboxes. You can add the username and password

combination in at a later step in the communication process, keeping everything

separate.

ii) Message

Once we have our Session object, it is time to move on to creating the message to

send. This is done with a type of Message. Being an abstract class, you must work

with a subclass, in most cases javax.mail.internet.MimeMessage. A MimeMessage

- 16 -
is a email message that understands MIME types and headers, as defined in the

different RFCs. Message headers are restricted to US-ASCII characters only, though

non-ASCII characters can be encoded in certain header fields.

To create a Message, we pass along the Session object to the MimeMessage

constructor:

MimeMessage message = new MimeMessage(session);

Once we have our message, we can set its parts, as Message implements the Part

interface (with MimeMessage implementing MimePart). The basic mechanism to set

the content is the setContent() method, with arguments for the content and the mime

type:

message.setContent("Hello", "text/plain");

If, however, we know we are working with a MimeMessage and our message is plain

text, we can use its setText() method which only requires the actual content,

defaulting to the MIME type of text/plain:

message.setText("Hello");

For plain text messages, the latter form is the preferred mechanism to set the content.

For sending other kinds of messages, like HTML messages, use the former.

For setting the subject, we use the setSubject() method:

message.setSubject("First");

- 17 -
iii) Address

Once we have created the Session and the Message, as well as filled the message

with content, it is time to address the letter with an Address. Like Message, Address

is an abstract class. You use the javax.mail.internet.InternetAddress class.

To create an address with just the email address, pass the email address to the

constructor:

Address address = new InternetAddress("president@whitehouse.gov");

If we want a name to appear next to the email address, you we pass that along to the

constructor, too:

Address address = new InternetAddress("president@whitehouse.gov",

"George Bush");

We need to create address objects for the message's from field as well as the to field.

Unless there is a problem in the mail server, there is nothing that can stop us from

sending a message that appears to be from anyone.

Once the addresses has been created, we connect them to a message in one of two

ways. For identifying the sender, we use the setFrom() and setReplyTo() methods.

message.setFrom(address)

If the message needs to show multiple from addresses, use the addFrom() method:

Address address[] = ...;

- 18 -
message.addFrom(address);

For identifying the message recipients, the addRecipient() method is used. This

method requires a Message.RecipientType besides the address.

message.addRecipient(type, address)

The three predefined types of address are:

Message.RecipientType.TO

Message.RecipientType.CC

Message.RecipientType.BCC

The JavaMail API provides no mechanism to check for the validity of an email

address.

iv) Transport

The final part of sending a message is to use the Transport class. This class speaks

the protocol-specific language for sending the message (usually SMTP). It is an

abstract class and works something like Session. The default version of the class can

be called using the static send() method:

Transport.send(message);

- 19 -
Or, one can get a specific instance from the session for your protocol, passing along

the username and password (blank if unnecessary), send the message, and close the

connection using the close() method as :

message.saveChanges(); // implicit with send()

Transport transport = session.getTransport("smtp");

transport.connect(host, username, password);

transport.sendMessage(message, message.getAllRecipients());

transport.close();

The latter way is best when one needs to send multiple messages, as it will keep the

connection with the mail server active between messages. The basic send()

mechanism makes a separate connection to the server for each method call.

v) Store and Folder

Getting messages starts similarly to sending messages, with a Session. However,

after getting the session, we connect to a Store, quite possibly with a username and

password or Authenticator. Like Transport, one tells the Store what protocol to

use:

Store store = session.getStore("pop3");

store.connect(host, username, password);

- 20 -
After connecting to the Store, one can then get a Folder, which must be opened

before he/she can read messages from it:

Folder folder = store.getFolder("INBOX");

folder.open(Folder.READ_ONLY);

Message message[] = folder.getMessages();

For POP3, the only folder available is the INBOX. If you are using IMAP, you can have

other folders available.

Once we have a Message to read, we can get its content with getContent() or write

its content to a stream with writeTo(). The getContent() method only gets the

message content, while writeTo() output includes headers.

System.out.println(((MimeMessage)message).getContent());

Once you're done reading mail, close the connection to the folder and store.

folder.close(aBoolean);

store.close();

The boolean passed to the close() method of folder states whether or not to update

the folder by removing deleted messages.

- 21 -
4.4.3 Using the Java Mail API

i) Sending Messages

Sending an email message involves getting a session, creating and filling a message,

and sending it. One can specify his/her SMTP server by setting the mail.smtp.host

property for the Properties object passed when getting the Session:

String host = ...;

String from = ...;

String to = ...;

// Get system properties

Properties props = System.getProperties();

// Setup mail server

props.put("mail.smtp.host", host);

// Get session

Session session = Session.getDefaultInstance(props, null);

// Define message

MimeMessage message = new MimeMessage(session);

message.setFrom(new InternetAddress(from));

message.addRecipient(Message.RecipientType.TO,

new InternetAddress(to));

- 22 -
message.setSubject("Hello JavaMail");

message.setText("Welcome to JavaMail");

// Send message

Transport.send(message);

One should place the code in a try-catch block, as setting up the message and sending

it can throw exceptions.

ii) Fetching Messages

For reading mail, we get a session, get and connect to an appropriate store for our

mailbox, open the appropriate folder, and get our message(s). Also, we need to close

the connection when done.

String host = ...;

String username = ...;

String password = ...;

// Create empty properties

Properties props = new Properties();

// Get session

Session session = Session.getDefaultInstance(props, null);

// Get the store

Store store = session.getStore("pop3");

- 23 -
store.connect(host, username, password);

// Get folder

Folder folder = store.getFolder("INBOX");

folder.open(Folder.READ_ONLY);

// Get directory

Message message[] = folder.getMessages();

for (int i=0, n=message.length; i<n; i++) {

System.out.println(i + ": " + message[i].getFrom()[0]

+ "\t" + message[i].getSubject());

// Close connection

folder.close(false);

store.close();

The above code block just displays who the message is from and the subject.

iii) Deleting Messages and Flags

Deleting messages involves working with the Flags associated with the messages.

There are different flags for different states, some system-defined and some user-

defined. The predefined flags are defined in the inner class Flags.Flag and a few

examples of it are listed below:

Flags.Flag.ANSWERED

Flags.Flag.DELETED

- 24 -
Flags.Flag.RECENT

Flags.Flag.SEEN

Just because a flag exists doesn't mean the flag is supported by all mail

servers/providers. For instance, besides deleting messages, the POP protocol supports

none of them. Checking for new mail is not a POP task but one built into mail clients.

To delete messages, we set the message's DELETED flag:

message.setFlag(Flags.Flag.DELETED, true);

Open up the folder in READ_WRITE mode first though:

folder.open(Folder.READ_WRITE);

Then, when you are done processing all messages, close the folder, passing in a true

value to expunge the deleted messages.

folder.close(true);

To unset a flag, just pass false to the setFlag() method. To see if a flag is set, check

with isSet().

iv) Replying to Messages

The Message class includes a reply() method to configure a new Message with the

proper recipient and subject, adding "Re: " if not already there. This does not add any

content to the message, only copying the from or reply-to header to the new recipient.

- 25 -
The method takes a boolean parameter indicating whether to reply to only the sender

(false) or reply to all (true).

v) Working with Attachments

Attachments are resources associated with a mail message, usually kept outside of the

message like a text file, spreadsheet, or image. As with common mail programs like

Eudora and pine, one can attach resources to your mail message with the JavaMail

API and get those attachments when you receive the message.

Sending Attachments

Sending attachments is quite like building up the parts to make the complete message.

After the first part, the message text, we add other parts where the DataHandler for

each is your attachment, instead of the shared handler in the case of a forwarded

message. If one is reading the attachment from a file, his/her attachment data source is

a FileataSource. Reading from a URL, it is a URLDataSource. Once we have our

DataSource, we just pass it on to the DataHandler constructor, before finally

attaching it to the BodyPart with setDataHandler(). Assuming we want to retain the

original filename for the attachment, the last thing to do is to set the filename

associated with the attachment with the setFileName() method of BodyPart.

Getting Attachments

Getting attachments out of one’s messages is a little more involved than sending them,

as MIME has no simple notion of attachments. The content of one’s message is a

Multipart object when it has attachments. One then needs to process each Part, to

get the main content and the attachment(s). Parts marked with a disposition of

- 26 -
Part.ATTACHMENT from part.getDisposition() are clearly attachments. However,

attachments can also come across with no disposition (and a non-text MIME type) or a

disposition of Part.INLINE. When the disposition is either Part.ATTACHMENT or

Part.INLINE, you can save off the content for that message part. Just get the original

filename with getFileName() and the input stream with getInputStream().

The saveFile() method just creates a File from the filename, reads the bytes from

the input stream, and writes them off to the file. In case the file already exists, a

number is added to the end of the filename until one is found that doesn't exist.

- 27 -
DESIGN

5.1 DATA FLOW DIAGRAMS

A data flow diagram (DFD) is a graphical representation of the "flow" of data

through an information system. A data flow diagram can also be used for the

visualization of data processing (structured design). It is common practice for a

designer to draw a context-level DFD first which shows the interaction between the

system and outside entities. This context-level DFD is then "exploded" to show more

detail of the system being modelled.

Top-Down Approach

1. The system designer makes a context level DFD, which shows the interaction (data

flows) between the system (represented by one process) and the system

environment (represented by terminators).

2. The system is decomposed in lower level DFD (Zero) into a set of processes, data

stores, and the data flows between these processes and data stores.

3. Each process is then decomposed into an even lower level diagram containing its

subprocesses.

4. This approach then continues on the subsequent subprocesses, until a necessary

and sufficient level of detail is reached which is called the primitive process (aka

chewable in one bite).

- 28 -
The following are the 0-level and 1-level data flow diagrams related to this project:

0-level DFD

1-level DFD(admin)

- 29 -
1-level DFD (user)

- 30 -
5.2 USE CASE DIAGRAM
Use case diagram is the graphical representation of a system describing the “what” of

a system and not “how”.

These can be decomposed into further levels of abstraction. The components are:

1. Actor: An actor or an external agent lies outside the system model but

interacts with it on some or the other way. It may be a person, machine, or an

info system. It is represented by a stick figure.

2. Use case: It is initiated by the user with a particular goal in mind, and

completes successfully when the goal is satisfied.

It captures who(actor) does what(interaction) with the system, for what

purpose(goal), without dealing with the system internals.

The following is the use case diagram related to the project:

- 31 -
Use case diagram

- 32 -
5.3 SEQUENCE DIAGRAMS

A Sequence diagram depicts the sequence of actions that occur in a system. The

invocation of methods in each object, and the order in which the invocation occurs is

captured in a Sequence diagram. This makes the Sequence diagram a very useful tool

to easily represent the dynamic behavior of a system.

A Sequence diagram is two-dimensional in nature. On the horizontal axis, it shows the

life of the object that it represents, while on the vertical axis, it shows the sequence of

the creation or invocation of these objects.

Because it uses class name and object name references, the Sequence diagram is very

useful in elaborating and detailing the dynamic design and the sequence and origin of

invocation of objects. Hence, the Sequence diagram is one of the most widely used

dynamic diagrams in UML.

A sequence diagram is made up of objects and messages. Objects are represented

exactly how they have been represented in all UML diagrams—as rectangles with the

underlined class name within the rectangle.

Object: The primary element involved in a sequence diagram is an Object—an

instance of a class. A Sequence diagram consists of sequences of interaction among

different objects over a period of time. An object is represented by a named rectangle.

The name to the left of the ":" is the object name and to its right is the class name.

Message: The interaction between different objects in a sequence diagram is

represented as messages. A message is denoted by a directed arrow. Depending on the

- 33 -
type of message, the notation differs. In a Sequence diagram, you can represent simple

messages, special messages to create or destroy objects, and message responses.

The sequence diagrams related to the project are:

Admin end sequence diagram

- 34 -
User end sequence diagram

- 35 -
DATABASE DESIGN

The following are the tables made in the database as Back End

User

Field Name Data Type Width

Mem_login Text 50

Mem_password Text 50

Men_name Text 50

Mem_lname Text 50

Mem_gender Text 50

Mem_day Number Long

Mem_month Text 50

Mem_year Number Long

Activate Text 50

- 36 -
Address Book

Field Name Data Type Width

UserId Text 50

Name Text 50

Last Name Text 50

Email Text 50

Phone Number Long

Mobile Number long

Inbox

Field Name Data Type Width

msgid Autonumber Long

userid Text 50

- 37 -
mdate Text 50

mtime Text 50

to Text 50

mfrom Text 50

cc Text 50

sub Text 50

msg Text 255

attach text 50

Themes

Field Name Data Type Width

username Text 50

tableimage Text 50

bgimage Text 50

- 38 -
 Admin

Field Name Data Type Width

admin_name Text 50

admin_password Text 50

- 39 -
SCREENSHOTS

7.1 USER END

Registration page

- 40 -
Filled registration page

- 41 -
Registration done

- 42 -
Login page

- 43 -
Error in login

- 44 -
If fields are not filled properly

- 45 -
User entries

- 46 -
User home

- 47 -
Composing mail

- 48 -
Attaching a file

- 49 -
User inbox

- 50 -
read message

- 51 -
Attachment download

- 52 -
Reply to a mail

- 53 -
Address book

- 54 -
Add contact

- 55 -
Searching

- 56 -
Search results

- 57 -
Sent items

- 58 -
My settings

- 59 -
Changing theme

- 60 -
Changed theme

- 61 -
7.2 ADMIN END

Admin login page

- 62 -
Admin home

- 63 -
Activate/deactivate profile

- 64 -
Taking database backup

- 65 -
Password change

- 66 -
FUTURE SCOPE

The Project can be upgraded to a fully Functional Mailing system after adding the

below mentioned features:-

 Searching in the address book on the basis of any field and selecting the

recipients from therein.

 Editing user profile.

 Text formatting.

 Sending a particular mail to multiple recipients.

 Forwarding the mails.

- 67 -
BIBLIOGRAPHY and REFERENCES

 Java Network Programming by Elliotte Rusty Harold

 Internet Email by David Wood

 Internet Email Protocols:A Developer’s Guide by Kevin Johnson

 JavaServer Pages By Hans Bergsten

 Core Servlets & JavaServer Pages by Marty Hall

 Professional JSP by Wrox publisher

 Tomcat Kick Start by Martin Bond & Debbie Lan

 www.java.sun.com

 www.w3schools.com

- 68 -
CONCLUSION

This project is designed to meet the requirements of a standard mailing system. It has

been developed using JSP, HTML, JavaScript and JDBC and the database has been

built in MS-Access. For designing the system we have used simple data flow

diagrams, use case diagrams and sequence diagrams.

The work in this project teaches us some essential skills like:

 Using system analysis and design techniques like data flow diagrams, use case

diagrams, sequence diagrams etc.

 Understanding programming logic and language along with the utilities like

reports.

- 69 -

Das könnte Ihnen auch gefallen