Program that can communicate with a smtp email server, JAVA Programming


Your task in this assignment is to develop a Java program that can communicate with a real SMTP email server for sending emails. It should have a graphical user interface (GUI).


1.  To enhance the functionality of the program developed in Assignment 1 so that the program communicates with an SMTP server using TCP Sockets - i.e. to practise implementing networked applications. 

2.  To practise the development of a graphical user interface (GUI) and use of event handling in Java.

3.  To practise using the extensive Java libraries, e.g. for the TCP connection and the user interface development.

4.  To practise object-oriented development (structuring of program). 


Your program must have the following parts: 

1.  An EmailSender object which receives an object of type Message (created in assignment 1) and sends it using a Socket connection to an SMTP server.

2.  The GUI must have: 

a. Text input fields for each required field, 

b.  a send button to send the email

c.  a clear (or restart) button to clear fields (to, from, subject, message etc)

d.  two text areas, 

i.  one to compose the email message and  ii.  A second to display server responses  

3.  A Logger class which makes a log entry whenever an email is sent or an unsuccessful attempt is made. The log entry is made in a file called 'emaillog.txt', which is in a subdirectory of the directory of the program. The subdirectory is called 'logs'. 

20/04/2011 17:45:55;;; "Coffee break"; status: success 111111@swin stands for the sender, 222222@swin. for the recipient, and "Coffee break" for  the subject line of the sent message.

4.  The code should be easy to read



1.  When the program is started (from command line using "java Test"), the user interface is shown. The sender field shows a default e-mail address.

2.  The user types the necessary data into the appropriate fields. The program validates the e-mail addresses. (The best time to do this is when the cursor leaves the field of an e-mail address.)

3.  When the user presses the Send button, the program creates a Message object and stores all the information in the fields of the user interface in the Message object. 

4.  The EmailSender receives the Message object and opens a connection to the SMTP server.

5.  The event is logged in emaillog.txt. Depending on whether the mail has been sent successfully, the status is 'success' or 'failure'.

6.  In the case of a failure, use the exception handling mechanism to return the error message to the GUI for display. Give as much detail to the user as you can, but not Java messages (users don't understand stack traces).

7.  If the message was sent successfully, clear all fields (except the field that shows server feedback) so that a new message can be typed. Alternatively, you can have a 'Clear' button.


You must submit the following as part of the assignment

1.  Complete source code consisting of the Java classes described in assignments 1 and 2, possibly more.

2.  A UML class diagram of the program. The class diagram should show the names of the classes, the attributes and methods of the classes as well as the relationships between the classes.

Posted Date: 2/25/2013 4:57:29 AM | Location : United States

Related Discussions:- Program that can communicate with a smtp email server, Assignment Help, Ask Question on Program that can communicate with a smtp email server, Get Answer, Expert's Help, Program that can communicate with a smtp email server Discussions

Write discussion on Program that can communicate with a smtp email server
Your posts are moderated
Related Questions

Students will design, develop, test and document a Java application that reads data from an input file, processes the data, and then writes the processed data to an output file. CM

What are Commonsense Guidelines to prevent viruses? Discuss about Antivirus as well. Commonsense Guidelines to avoid viruses are as follows: 1. Do not open attachment of unwant

What are the Sub categories of Artificial Intelligence? Briefly explain any two? 1. Expert systems: Expert system is in which system that is in some limited sense, could repl

What is difference between time slicing and preemptive scheduling? Differences between preemptive and time scheduling are: In case of Preemptive scheduling the highest prior

You are to write a Java console application, following the Software Life Cycle model, which will read personnel records from a text file and store them in a data structure.  One li

The state chart diagram given below defines the thread states.     1.      Runnable - waiting for its turn to be picked for performing by the thread scheduler based o

require assistance in Java / Grails support We have a project which requires continuous maintenance / support and occasional feature development. Its running on Java 1.7 / Grail

Explain operator precedence in java ? It's probable to combine multiple arithmetic expressions in one statement. For example the subsequent line adds the numbers one by five: