You are on page 1of 4

Rochester Institute of Technology

RIT Golisano College of Computing and Information Sciences

Networking and Systems Administration

NSSA 101 Lecture Professor: Kennedy

SMTP Server and Client

Task:

Create a SMTP mail server and a SMTP mail client.

Server Objectives:

Using PYTHON, “sockets” and the Simple Mail Transport Protocol (SMTP),
to create a server program.

The server will conduct a successful SMTP conversation with a single


client. The server will display the conversation.

The server will run from the command, or terminal, window.

Client Objectives:

Using PYTHON, “sockets”, and the Simple Mail Transport Protocol (SMTP),
create a client program that will contact an SMTP server to send a text
email message.

The client program should provide some a GUI user interface.

When sending a message, the user must be able to enter the


following information into the GUI:

“From” email address

“To” email address


Rochester Institute of Technology

RIT Golisano College of Computing and Information Sciences

Networking and Systems Administration

SMTP server address, for example, mail.rit.edu or


127.0.0.1(this would mean there is an SMTP server running
on your machine)

The message

You must include a “Send” button. When the “Send” button is clicked, the
client will conduct a successful dialog with an SMTP server. The client
program must display the entire sequence of dialog messages between
the client and the server.
Rochester Institute of Technology

RIT Golisano College of Computing and Information Sciences

Networking and Systems Administration

SMTP

Simple Mail Transport Protocol is a set of messages which are exchanged


between a client program and a server program. The client initiates a network
connection with the server and the server responds with an identifying
message. This initial exchange is followed by a sequence of exchanges of
information until the message is sent. Here is an example from the Wikipedia
entry about SMTP (S: means the server sent the message and C: means the
client sent the message):

S: 220 smtp.example.com ESMTP Postfix

C: HELO relay.example.org

S: 250 Hello relay.example.org, I am glad to meet you

C: MAIL FROM:<bob@example.org>

S: 250 Ok

C: RCPT TO:<alice@example.com>

S: 250 Ok

C: RCPT TO:<theboss@example.com>

S: 250 Ok

C: DATA

S: 354 End data with <CR><LF>.<CR><LF>

C: From: "Bob Example" <bob@example.org>

C: To: Alice Example <alice@example.com>


Rochester Institute of Technology

RIT Golisano College of Computing and Information Sciences

Networking and Systems Administration

C: Cc: theboss@example.com

C: Date: Tue, 15 Jan 2008 16:02:43 -0500

C: Subject: Test message

C:

C: Hello Alice.

C: This is a test message with 5 header fields and 4 lines in the message
body.

C: Your friend,

C: Bob

C: .

S: 250 Ok: queued as 12345

C: QUIT

S: 221 Bye

{The server closes the connection}

The information between the DATA and the .(period) is the email message.

You might also like