项目报告
基于 C/S 的电子邮件简单收发系统设计与实现
电子邮件作为互联网中交换信息广泛的通信工具之一,如今都已被广大用户
接受。早期的电子邮件只是从一个计算机终端向另外一个计算机终端传送文本信
息,而现在的电子邮件不仅可以发送文本信息,还可以传送声音、图片、文档等
多种信息。很多邮件邮件客户端软件不断地被用户利用起来,例如 outlook,
Foxmail,但是这些邮件客户端对于很多用户来说却过于复杂。
为了方便用户快捷地收发邮件,本课题利用 SMTP 协议和 POP3 协议,经过前
期对系统的需求分析和对相关协议的了解,设计并实现了简单的电子邮件收发系
统。为了保证本系统功能的完整性,在实现该系统过程中,设计了邮件用户注册
模块,当用户首次使用本系统时,须注册一个邮件账号,然后才能进行其他的操
作。作为一个电子邮件客户端,邮件的发送与收取是其核心功能,本系统邮件发
送块实现电子邮件的发送,支持邮件的单个发送和群发,在邮件收取块,实现了
电子邮件的简单收取。另外还增加了地址薄管理块让用户更方便地管理自己的联
系人,对联系人进行添加、修改、删除等。
电子邮件;SMTP;POP3;邮件收发系统
Design and Implementation of Simple Email Receiving
and Sending System Based on C/S
Abstract
Email is the communication tool which is widely used in the internet to exchange
information. Now it has been accepted by many people. In the early days, email is
only used in transmitting pure text information from a computer terminal to another.
But at present, it is not limited in this, it can support many types of information, such
as voice, picture, document and so on. Much software has been used by users. such as
Outlook, Foxmail and so on. But they are too complex to many users.
In order to send and receive email conveniently, a simple email sending and
receiving system has been designed based on SMTP and POP3 protocol after
requirement analysis and protocols learning. To prove integrality of the system, the
block of accounts registering is necessary. When using this system first time, users
should register one account. It has the kernel function of sending and receiving email.
In the block of sending email, group sending is supported. In addition, there is an
address management block.
Key words: E-mail; SMTP; POP3; Mail Receiving and Sending System
目 录
总页数:27 页
1 引言....................................................................................................................................1
1.1 邮件客户端相关介绍........................................................................................................1
1.2 课题背景............................................................................................................................1
1.3 现状分析............................................................................................................................1
2 电子邮件相关协议............................................................................................................2
2.1 RFC822 邮件格式...............................................................................................................2
2.2 SMTP 协议...........................................................................................................................2
2.2.1 SMTP 协议简介...........................................................................................................2
2.2.2 SMTP 的命令与应答...................................................................................................3
2.3 POP3 协议...........................................................................................................................5
2.3.1 POP3 协议简介...........................................................................................................5
2.3.2 POP3 的命令和应答...................................................................................................6
3 系统需求分析....................................................................................................................7
3.1 功能需求............................................................................................................................7
3.1.1 邮件发送需求............................................................................................................8
3.1.2 邮件接收需求............................................................................................................8
3.1.3 附加功能需求............................................................................................................8
3.2 研究思路............................................................................................................................8
3.2.1 用户注册块................................................................................................................8
3.2.2 邮件发送块................................................................................................................8
3.2.3 邮件接收块................................................................................................................8
3.2.4 地址薄管理块............................................................................................................8
4 系统总体功能模块和系统总体流程................................................................................8
4.1 系统总体功能模块............................................................................................................8
4.2 系统流程............................................................................................................................9
5 系统功能实现....................................................................................................................9
5.1 新建账号模块....................................................................................................................9
5.1.1 模块功能....................................................................................................................9
5.1.2 核心实现....................................................................................................................9
5.1.3 运行界面..................................................................................................................10
5.2 发送邮件模块..................................................................................................................11
5.2.1 模块功能..................................................................................................................11
5.2.2 核心实现..................................................................................................................11
5.2.2 运行界面..................................................................................................................15
5.3 接收邮件模块..................................................................................................................16
5.3.1 模块功能..................................................................................................................16
5.3.2 核心实现..................................................................................................................16
5.3.3 运行界面..................................................................................................................16
5.4 地址薄模块......................................................................................................................17
5.4.1 模块功能..................................................................................................................17
5.4.2 核心实现..................................................................................................................17
5.4.3 运行界面..................................................................................................................21
6 系统功能测试..................................................................................................................21
6.1 发送邮件测试..................................................................................................................21
6.2 接收邮件测试..................................................................................................................22
6.3 地址薄管理测试..............................................................................................................23
6.4 测试结果..........................................................................................................................24
结 论..........................................................................................................................................24
参考文献..........................................................................................................................................25
致 谢..........................................................................................................................................26
声 明..........................................................................................................................................27
第 1 页 共 27 页
1 引言
1.1 邮件客户端相关介绍
电子邮件(Electronic Mail、E-mai1)又称电子信箱,它是—种用电子手段
提供信息交换的通信方式,是应用于网络上的使用最广泛的网络功能之一。到目
前为止,可以说电子邮件是 Internet 资源使用最多的一种服务,E-mail 不只局
限于信件的传递,还可用来传递文件、声音及图形、图像等不同类型的信息。电
子邮件不是“终端到终端”的服务,而是被称为“存贮转发式”的服务。“存贮
转发式”正是电子信箱系统的核心,利用存贮转发可进行非实时通信,属异步通
信方式。电子邮件的发送几乎是即时的并且可以一次发送给多个人,发送和接收
主要通过 SMTP 协议和 POP3 协议来实现,经过几十年的发展,电子邮件系统已经
形成了完善的技术体系。
电子邮件系统是一种新型的信息系统,是通信技术和计算机技术结合的产物。
电子邮件系统采用“存储转发”的机制来完成电子邮件的收发。邮件服务器处理
发送和接收消息的事项,并在处理电子邮件的过程中与其他机器进行通信。
图 1 工作流程图
1.2 课题背景
随着互联网技术的迅猛发展,网络给人们带来了很多便利,比如人们借助于
网络进行相互交流变得更加方便。电子邮件作为互联网中交换信息广泛的通信工
具之一,如今都已被广大网民接受。在了解 RFC 底层协议的基础上,本课题开发
了这个功能相对简单实用的邮件客户端程序。
1.3 现状分析
电子邮件来源于专有电子邮件系统,早在 Internet 流行以前,电子邮件就
已经存在了,是在主机-多终端的主从式体系中从一台计算机终端向另一台计算
机终端传送文本信息的相对简单的方法下发展起来的。经历了漫长的过程之后,
它现在已经演变成为一个更加复杂并丰富得多的系统,可以传送声音、图片、图
像、文档等多媒体信息,以至于如数据库或账户报告等更加专业化的文件都可以
以电子邮件附件的形式在网上分发。现在,电子邮件已成为许多商家和组织机构
的生命血脉,用户可以通过电子邮件的讨论会进行项目管理,并且有时还根据快
速而且跨洲际的电子邮件信息交换进行重要的决策行动。毫无疑问的是,