使用JavaMail/JAF开发中文邮件系统的关键技术研究
- 格式:pdf
- 大小:191.71 KB
- 文档页数:3
邮件客户端使用Java语言和JavaMail库开发的小程序邮件是现代社会中非常重要的通信工具之一,而邮件客户端则是使用邮件的主要方式之一。
为了提供一个便捷的邮件发送和接收工具,本文将介绍如何使用Java语言和JavaMail库开发一个小型的邮件客户端程序。
一、引言随着互联网的普及,电子邮件已经成为人们日常生活中不可或缺的一部分。
邮件客户端是用于发送和接收电子邮件的软件应用程序。
本文将通过使用Java语言和JavaMail库开发一个小型的邮件客户端程序,来演示如何利用编程语言的力量来简化邮件的处理和管理。
二、准备工作在开始开发之前,我们需要准备一些必要的工作。
首先,我们需要安装Java开发环境(JDK)以及支持邮件功能的JavaMail库。
其次,我们需要一个有效的邮件服务器地址、端口号、用户名和密码,这些信息用于程序连接和认证邮件服务器。
三、创建项目使用Java语言和JavaMail库开发邮件客户端的第一步是创建一个新的Java项目。
我们可以使用任何集成开发环境(IDE)来创建和管理项目,比如Eclipse、IntelliJ IDEA等。
创建项目后,我们需要在项目的依赖项中添加JavaMail库,以便在代码中使用该库提供的功能。
四、连接邮件服务器在程序中连接邮件服务器是发送和接收邮件的基础步骤。
我们可以使用JavaMail库中提供的JavaMailSession类来创建一个与邮件服务器的会话连接。
通过设置邮件服务器地址、端口号、用户名和密码,我们可以建立与邮件服务器的连接,并进行后续的邮件处理操作。
五、发送邮件发送邮件是邮件客户端的主要功能之一。
我们可以使用JavaMail库提供的SMTP协议来发送邮件。
首先,我们需要创建一个MimeMessage对象,用于表示要发送的邮件。
然后,我们可以设置邮件的发送人、接收人、主题、内容等信息。
最后,使用JavaMailSession类中的Transport对象发送邮件。
JavaMail组件实现邮件功能实现邮件收发功能需要3个jar包:1.JavaMail组件保内的mail.jar和smtp.jar包2.JAF组件包⾥的activition.jar。
复制到WebRoot/WEB-INF/lib⽬录下。
⼀、编写index.jsp页⾯,具体代码如下:1 <%@ page language="java" contentType="text/html; charset=gb2312"2 pageEncoding="gb2312"%>3<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "/TR/html4/loose.dtd">4<html>5<head>6<meta http-equiv="Content-Type" content="text/html; charset=gb2312">7<title>welcome</title>8</head>9<body>10<form action="sendMail.jsp" method="post" name="form1">11<table width="75" border="0" align="center" cellspacing="1"12 bgcolor="#006600" class="black">13<tr bgcolor="#ffffff">14<td width="24%">收信⼈地址:</td>15<td width="76%"><input name="to" type="text" id="to"></td>16</tr>17<tr bgcolor="#ffffff">18<td >主题:</td>19<td ><input name="title" type="text" id="title"></td>20</tr>21<tr>22<td height="18" colspan="2" bgcolor="#ffffff">23信件类型24<select name="emailtype" id="emailtype">25<option value="text/plain" selected>Text</option>26<option value="text/html" selected>Html</option>27</select>28</td>29</tr>30<tr>31<td height="53" colspan="2" bgcolor="#ffffff">32<textarea rows="5" cols="50" name="content" id="content"></textarea>33</td>34</tr>35<tr align="center">36<td colspan="2" bgcolor="#ffffff">37附件1(⾃定义):38<input name="fj1" type="text" id="fj1">39 (输⼊⽂本信息)40</td>41</tr>42<tr align="center" valign="bottom">43<td colspan="2" bgcolor="#ffffff">44附件2(本地):45<input name="fj2" type="file" id="fj2" size="10">46</td>47</tr>48<tr align="center">49<td colspan="2" bgcolor="#ffffff">50附件3(远程):51<input name="fj3" type="text" id="fj3" value="http://">52 (输⼊URL)53</td>54</tr>55<tr align="center">56<td colspan="2" bgcolor="#ffffff">5758<input name="submit" type="submit" value="发送">59<input name="submit2" type="reset" value="重置">60</td>61</tr>62</table>63</form>64</body>65</html>⼆、创建sendMail.jsp页⾯,具体代码如下:<%@ page language="java" contentType="text/html; charset=gb2312"pageEncoding="gb2312"%><%request.setCharacterEncoding("gb2312"); %><%@ page import="java.util.*,javax.mail.*" %><%@ page import="javax.mail.internet.*"%><%@ page import="javax.activation.*" %><%@ page import=".*" %><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "/TR/html4/loose.dtd"> <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Insert title here</title></head><body><%try{String tto=request.getParameter("to");String ttitle=request.getParameter("title");String emailtype=request.getParameter("emailtype");String tcontent=request.getParameter("content");String tfj1=request.getParameter("fj1");String tfj2=request.getParameter("fj2");String tfj3=request.getParameter("fj3");//声明properities存储发件服务器信息Properties props=new Properties();props.put("mail.smtp.host", "");props.put("mail.smtp.auth", "true");//创建邮件回话Session s=Session.getInstance(props);s.setDebug(true);//创建⼀个消息对象MimeMessage message=new MimeMessage(s);InternetAddress from=new InternetAddress("393743083@");message.setFrom(from);InternetAddress to=new InternetAddress(tto);message.setRecipient(Message.RecipientType.TO, to);message.setSubject(ttitle);message.setSentDate(new Date());Multipart mm = new MimeMultipart();BodyPart mdp=new MimeBodyPart();mdp.setContent(tcontent, emailtype+";charset=gb2312");mm.addBodyPart(mdp);//附件1mdp=new MimeBodyPart();DataHandler dh=new DataHandler(tfj1,"text/plain;charset=gb2312");mdp.setFileName("text.txt");mdp.setDataHandler(dh);mm.addBodyPart(mdp);//附件2mdp=new MimeBodyPart();FileDataSource fds=new FileDataSource(tfj2);dh=new DataHandler(fds);int ddd=stIndexOf("\\");String fname=tfj2.substring(ddd);String ffname=new String(fname.getBytes("gb2312"),"ISO8859-1");mdp.setFileName(ffname);mdp.setDataHandler(dh);mm.addBodyPart(mdp);//附件3mdp=new MimeBodyPart();URL urlfj=new URL(tfj3);URLDataSource ur=new URLDataSource(urlfj);dh=new DataHandler(ur);int ttt=stIndexOf("/");String urlname=tfj3.substring(ttt);mdp.setFileName(urlname);mdp.setDataHandler(dh);mm.addBodyPart(mdp);message.setContent(mm);message.saveChanges();//发送邮件Transport transport=s.getTransport("smtp");transport.connect("",⽤户名,密码);transport.sendMessage(message, message.getAllRecipients());transport.close();%><div align="center"><p><font color="#ff6600">发送成功</font></p><br><a href="sendMail.jsp">再来⼀封</a></div><%}catch(MessagingException e){out.println(e.toString());}%></body></html> 注:腾讯邮箱需要开通smtp功能。
Java-JavaMail邮件开发(3)spring+JavaMail+Velocity 1、spring + Java Mail + Velocity项⽬结构:注意:⽤户包中引⼊各包的顺序问题。
如velocity-2.1。
beans.xml<?xml version="1.0" encoding="UTF-8"?><!-- spring配置⽂件的根元素,使⽤spring-beans-4.0.xsd语义约束 --><beans xmlns:xsi="/2001/XMLSchema-instance"xmlns="/schema/beans"xsi:schemaLocation="/schema/beans/schema/beans/spring-beans-4.0.xsd"><bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"></bean><bean id="propertyConfigurer"class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="locations" value="mail.properties"/></bean><bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"><property name="host" value="${mail.host}"/><property name="username" value="${er}"/><property name="password" value="${mail.pwd}"/></bean><bean id="javaMailSenderService" class="com.lfy.sendmail.JavaMailSenderService"/><bean id="javaMailSenderImplService" class="com.lfy.sendmail.JavaMailSenderImplService"/><!-- VelocityEngineFactory --><bean id="velocityEngineFactory" class="org.springframework.ui.velocity.VelocityEngineFactoryBean"><property name="velocityProperties"><props><prop key="resource.loader">class</prop><prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader</prop></props></property></bean><bean id="velocityEngineService" class="com.lfy.velocity.VelocityEngineService"/></beans>VelocityEngineService.javapackage com.lfy.velocity;import org.apache.velocity.app.VelocityEngine;import org.springframework.beans.factory.annotation.Autowired;public class VelocityEngineService {@Autowiredprivate VelocityEngine velocityEngine;public VelocityEngine getVelocityEngine() {return velocityEngine;}public void setVelocityEngine(VelocityEngine velocityEngine) {this.velocityEngine = velocityEngine;}}JavaMailSenderImplService.javapackage com.lfy.sendmail;import javax.mail.internet.MimeMessage;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.mail.SimpleMailMessage;import org.springframework.mail.javamail.JavaMailSenderImpl;/*** 2、spring⽀持的第⼆种发送器JavaMailSenderImpl* @author lfy**/public class JavaMailSenderImplService {@Autowiredprivate JavaMailSenderImpl javaMailSenderImpl;public JavaMailSenderImpl getJavaMailSenderImpl() {return javaMailSenderImpl;}public void setJavaMailSenderImpl(JavaMailSenderImpl javaMailSenderImpl) {this.javaMailSenderImpl = javaMailSenderImpl;}/*** simple content* @param message*/public void send(SimpleMailMessage message){javaMailSenderImpl.send(message);System.out.println("JavaMailSenderImpl:send silpleMessage successfully.");}/*** Velocity content* @param message*/public void sendWithVelocity(MimeMessage message) {javaMailSenderImpl.send(message);System.out.println("JavaMailSenderImpl:send mimeMessage successfully.");}}index.vm<html><head><style type="text/css">h4{color:red;background:#efefef;}</style></head><body><h4>${user} </h4><p><p><i>${content}</i></body></html>springJavaMailSender.javapackage com.lfy.main;import java.util.HashMap;import java.util.Map;import javax.mail.MessagingException;import javax.mail.internet.MimeMessage;import org.apache.velocity.app.VelocityEngine;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;import org.springframework.mail.javamail.MimeMessageHelper;import org.springframework.ui.velocity.VelocityEngineUtils;import com.lfy.sendmail.JavaMailSenderImplService;import com.lfy.velocity.VelocityEngineService;public class springJavaMailSender {public static void main(String[] agrs) throws MessagingException {//创建spring容器ApplicationContext ctx=new ClassPathXmlApplicationContext("beans.xml");JavaMailSenderImplService javaMailSenderImplService = (JavaMailSenderImplService)ctx.getBean("javaMailSenderImplService");VelocityEngine velocityEngine=(VelocityEngine)((VelocityEngineService)ctx.getBean("velocityEngineService")).getVelocityEngine(); Map<String,Object> model=new HashMap<String,Object>();model.put("user", "Tomcat");model.put("content", "Hello");String emailText=VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "index.vm", "UTF-8", model);MimeMessage msg=javaMailSenderImplService.getJavaMailSenderImpl().createMimeMessage();MimeMessageHelper helper=new MimeMessageHelper(msg,true);helper.setFrom("xxxxxxxxxx@");helper.setTo("xxxxxxxx@");helper.setCc("xxxxxxxx@");helper.setSubject("Velocity模板测试");helper.setText(emailText, true);javaMailSenderImplService.sendWithVelocity(msg);}}运⾏效果:2、使⽤Maven配置使⽤Velocity。
利⽤JavaGUI和javamail实现的email客户端摘要本系统是⽤ java 语⾔实现的⼀个 Email客户端,主要⽤到 java GUI 图形界⾯设计和 java mail ⼯具包,它适⽤于所有⽤户,⽆管理员设置,可以实现⽹络邮箱的邮件发送和邮件收取的基本功能,还具有通讯录的存储功能,针对⽤户的需求,本Email 客户端具有以下两⼤模块:1.基本设置模块;此模块主要包括⽤户设置和邮箱设置两⼤内容:1.1 ⽤户设置:主要设置⽤户的⼀些基本信息,如⽤户名,⽤户密码等设置1.2 邮箱设置:主要设置邮箱服务器,SMTP,POP3等2. Email功能模块;此模块根据⼤众⽤户的需求划分了以下三个部分:2.1收取邮件功能;2.2发送邮件功能;2.3通讯录功能;该系统的开发过程为:1.Email客户端的需求分析;2.Email客户端的系统分析;3.Email客户端的功能模块划分划分;4.Email客户端的数据库设计;5.Email客户端的界⾯设计;6.Email客户端的功能模块设计及代码实现关键字:java,java GUI,java mailAbstractThis email client system is developed in java language using java GUI and java mail tools .It can be used by any users who want to use it . The system is not including manager settings and it can finish the function of sending and accepting mails in web mail system, it can store user information a function like a address book in the web. The systems need to achieve the overall function to run two parts, as follows1. The basic settingsTwo parts are followed:1.1 Maintenance System Administrators basic information;1.2 Student response functions;2. Email functionsThree function will be available2.1 Sending mails2.2 Receiving mails2.3 Address bookThe system development process :1. Email client needs analysis;2. Email client system analysis;3. Email client function modules partition;4. Email client design;5. Email client interface design;6. Email client functional design and code modules to achieveKey word:java , java GUI ,java mail⽬录前⾔ (4)第1章系统概述及系统分析-------------------------------------------- 51.1系统概述 (5)1.1.1基本设置模块--------------------------------------------------- 51.1.2 Email功能模块------------------------------------------------- 5 1.2 需求分析 (5) 1.3 可⾏性分析 (5)1.3.1技术可⾏性分析------------------------------------------------- 51.3.2环境可⾏性分析------------------------------------------------- 61.3.3经济可⾏性分析------------------------------------------------- 6第2章系统开发基本介绍---------------------------------------------- 72.1 选题背景与⽬的--------------------------------------------------- 72 .2 系统开发⼯具---------------------------------------------------- 72 .3 系统开发环境---------------------------------------------------- 72 .4开发技术概述---------------------------------------------------- 72 .4.1 J2EE概述----------------------------------------------------- 72 .4.2 Java GUI ------------------------------------------------------ 82 .4.3 Java mail ----------------------------------------------------- 9第3章系统总体设计------------------------------------------------- 103 .1 系统功能模块划分----------------------------------------------- 103 .2系统具体功能模块基本介绍--------------------------------------- 103 .2.1 发件箱------------------------------------------------------- 103 .2.2 收件箱------------------------------------------------------- 113 .2.3 通讯录------------------------------------------------------- 11第4章系统详细设计及系统实现--------------------------------------- 134 .1 章节内容总体介绍----------------------------------------------- 134 .2各模块功能详细设计--------------------------------------------- 134 .2.1 发送邮件功能的实现------------------------------------------- 134 .2.1.1 发送普通邮件功能------------------------------------------- 134 .2.1.2 邮件附件的功能实现----------------------------------------- 194 .2.2 收取邮件功能的实现------------------------------------------- 204 .2.3 通讯录功能的实现--------------------------------------------- 284 .2.4其他功能----------------------------------------------------- 314 .2.4.1 其他界⾯实现与通讯录的连接功能----------------------------- 314 .2.4.2 邮件未存储对⽤户提⽰功能----------------------------------- 314 .2.4.3 复制、删除邮件功能----------------------------------------- 324 .2.4.4 ⽤户信息设置功能------------------------------------------- 34结束语-------------------------------------------------------------- 36谢辞 (37)参考⽂献 (37)前⾔邮件系统是⼀套单独的系统,要有⾃⼰的服务器,在邮件系统中可以设多个域,每个域中可以设多个⽤户,⽐如说我买了anymacro 或快客的邮件系统,可以进⾏多项设置.它的数据是放在⾃⼰的服务器上.随着信息技术的提⾼,⽹络的普及于发展,越来越多的⽹络⼯具随之产⽣出来,⽹络邮箱就是其中之⼀,它可以通过⽹络来实现⼈们之间的通信,可以给⼈们的⼯作带来极⼤的⽅便,同时也缩短了⼈与⼈之间的距离,使⼈们在通信上需要花费的时间更短。
XXX本科毕业设计基于JavaMail的电子邮件系统的设计与实现邮件系统的设计与实现摘要在过去的几十年里,人们主要通过书信与相隔较远的人相互交流情感与思想。
而当今世界人们更多的是使用电子邮件,与传统的书信相比,电子邮件具有使用简易、投递迅速、收费低廉,易于保存、全球畅通无阻等优点。
本文设计并实现了一套邮件系统。
首先研究了与系统相关的技术,其次分析了系统功能、性能和数据的需求,设计了系统构架、系统功能和数据库,并实现了系统的主要功能。
本文的系统构架是基于浏览器/服务器的三层架构,使用Java 和S2SH框架开发而成。
在数据存储上使用了免费、开源、跨平台的MySQL数据库,邮件服务器使用了免费、开源的支持SMAP协议发送电子邮件和IMAP协议接收电子邮件的Apache James邮件服务器。
通过系统设计的用户注册和登陆、用户信息管理、邮件管理等模块,对邮件系统进行实现。
本系统具有功能丰富、结构清晰、运行效率高、数据访问效率高等优异性能,后期易于维护,可扩展性行比较好。
本系统还存在以下几个方面的工作尚需完善,即增加联系人管理模块,增强系统的稳定性,增强系统的安全性。
关键词:电子邮件,James邮件服务器,MySQL,Java,S2SH邮件系统的设计与实现Mail System Design and ImplementationAbstractIn the past few decades, people mainly exchange ideas with each other by letters. But today people are communicating with each other via e-mail, compared with the letter, e-mail correspondence with easy to use, fast delivery, low-cost, easy to store, the world's smooth and so on.This article has designed and implemented a mail system. First , study technologies related to the system. Then , analyses the system functions, performance and the data requirements, and also design the system architecture, system functions and database, and finally the main functions of the system come into shap . The system architecture is developed basing on a three-tier browser / server architecture, using Java and S2SH framework. The Data storage take use of free, open-source, cross-platform MySQL database. The mail server use the free, open-source Apache James mail server that supports SMAP protocol to send e-mails and the IMAP protocol to receive e-mails. Develop the E-mail system by different module of the system design, including user registration and login, the user information management, mail management.This system has the feature-rich, clear structure, high efficiency, excellent performance of high efficiency of data access, and it is not only easy to maintain in latter stages but also outstanding in it`s scalable sexual activity.There still exists problems that need farther perfection in The system from following aspects, like increasing the contact management module, enhancing the stability and security of the system.Keywords: E-mail, James mail server, MySQL, Java, S2SHXXX本科毕业设计目录1 绪论 (1)1.1 课题研发背景 (1)1.2 选题的意义 (1)1.3 发展现状 (1)1.4 本文结构安排 (2)2 技术与工具介绍 (3)2.1 框架简介 (3)2.2 开发工具简介 (4)2.3 电子邮件简介 (6)2.4 小结 (7)3 需求分析 (8)3.1 实际业务操作流程 (8)3.2 系统设计的目标 (8)3.3 系统需求分析 (9)3.3.1 功能需求分析 (9)3.3.2 性能需求分析 (10)3.3.3 数据库需求分析 (11)3.4小结 (11)4 总体设计 (12)4.1 数据库的设计 (12)4.1.1 概念结构设计 (12)4.1.2 逻辑结构设计 (13)4.2 小结 (15)5 详细设计与实现 (16)5.1 系统体系结构设计 (16)5.2 系统模块设计 (17)5.2.1 用户登录邮件系统设计 (17)5.2.2 注册新用户信息的设计 (18)5.2.3 用户找回密码信息设计 (18)5.2.4 用户发送电子邮件设计 (20)5.2.5 用户查看电子邮件设计 (21)邮件系统的设计与实现5.3 系统模块的实现 (22)5.3.1 用户登录邮件系统的实现 (22)5.3.2 注册新用户的实现 (23)5.3.3 用户找回密码的实现 (24)5.3.4 用户发送电子邮件的实现 (26)5.3.5 用户查看电子邮件的实现 (27)5.4 小结 (28)6 测试 (29)6.1 测试环境 (29)6.2 功能测试 (29)6.3 用户界面测试 (30)6.4 单元测试 (31)6.5 小结 (31)7 结束语 (32)7.1总结 (32)7.2展望 (32)附录 (33)参考文献 (38)致谢 (39)XXX本科毕业设计1 绪论1.1 课题研发背景电子邮件(简称E-mai1)又称电子信箱、电子邮政,它是—种用电子手段提供信息交换的通信方式。
第28卷 第6期2006年6月武 汉 理 工 大 学 学 报JOURNAL OF WUHAN UNIVERSITY OF TECHNOLOGY Vol.28 No.6 Jun.2006基于JavaMail API 的Web 邮件系统开发钟 珞,刘 玲,夏红霞(武汉理工大学计算机科学与技术学院,武汉430070)摘 要: E mail 通信在Java 服务器编程中占有非常重要的地位。
阐述了Web 邮件系统所涉及的几个协议,对J2EE JavaM ail A PI 的结构框架和核心类进行了介绍,描述了系统架构,并给出了其中发送邮件功能的详细设计过程。
Java M ail 结合JSP 的结构化特性,易于实现灵活高效、方便移植的Web 邮件应用程序。
关键词: JavaM ail AP I; 电子邮件; 邮件发送中图分类号: T N 915.04文献标志码: A 文章编号:1671 4431(2006)06 0084 03Development Research of Web Mail System Based on JavaMail APIZ H ON G L uo ,LI U L ing,XIA H ong x ia(School o f Computer Science and T echnology ,Wuhan U niv ersity of T echno logy,Wuhan 430070,China)Abstract: E mail is the most important and ex tensive applicat ion of I nternet,it stands a v er y important position in Java server pr ogramming.T his paper first ex patiated on some protocols come down to the Web mail system,and then introduced the architecture and core classes of J2EE JavaM ail A PI.After that,the article presented the system framew ork and t he detailed de sign pr ocess of mail sending.In co nclusion,it can easily implement flexible,high effective and transplantable W eb mail applica tions with JavaM ail and structured JSP.Key words: JavaM ail API ; E mail; mail sending收稿日期:2006 03 23.基金项目:教育部高校行动计划智能科学与技术(2004XD 03).作者简介:钟 珞(1957 ),男,教授,博士生导师.E mail:liuling com随着互联网的发展,人们使用最多的服务之一就是电子邮件,用户最初只能通过Outlook 、Foxm ail 等客户端软件来收发自己的邮件。
薛 岚 江西信息应用职业技术学院计算机技术系摘要:互联网的飞速发展便捷了人们的生活,加强了人与人之间的联系,提高了办事效率。
各工作单位办公不再局限于使用OA,因为通常OA仅限于在单位内部办公使用,如果工作人员外出办事无法上网将影响办公的及时性准确性,快信系统能弥补这方面的问题。
快信系统以办公系统为基础,主要针对的仍然是单位内部各部门之间及单位与外界的办公,但办公事宜随时可以通过手机和E-mail发送至工作人员。
当工作人员外出办事不在线也可随时快捷方便地通过手机查询单位通知、办公事宜、紧急情况等,而不是必须要有一台可上网的电脑。
本文按照软件工程开发流程采用J2EE技术介绍适用于学院日常办公的快信系统项目的研发。
关键词:项目;开发过程;短信猫技术;JavaMail中图分类号:TP302 文献识别码:A 文章编号:1001-828X(2015)023-000314-02一、需求分析学院快信系统主要是用来解决学院内部各部门之间及与外部的日常办公事宜,包括信息更新查询、紧急事宜通知、信息上传、信息交流沟通,特别是当教职员工外出办事不在线快信系统提供手机短信收发功能及E-MAIL群发功能。
通过多次在学院行政部门及教学部门调研、沟通、讨论,确定了系统的功能。
其功能需求主要体现在以下几个方面:(一)通信名片管理用于学院教职工及和学院有工作往来的客户的管理及其通讯、手机、联系方式的管理维护及加载等。
(二)短信收发管理学院通告、通知、最新消息等通过短信群发给教职工通信名片里的所有人,也可选择发送给某些人。
同时员工也可通过短信有一些信息发送至快信系统。
(三)常用短语信息库管理存储了大量常用通知、通告、消息短语,使用时可直接从信息库中调用代替人工输入,同时管理员还可以完善、新增短语信息。
(四)邮件收发完成单独及群发邮件、接收邮件、管理邮件功能,邮件内容可以自行编辑,可以从信息库中选择常用内容,收件人名单从通信名片夹中自动获取。
基于JavaMail的邮件收发系统摘要电子邮件在当今社会中扮演了一个很重要的角色。
越来越多的人在使用它。
而且用它的人数势必会继续增加。
本文介绍了Javamail邮件收发系统的开发背景,对国内外现有的多种成熟的电子邮件系统进行分析和比较,总结出它们的优缺点,对Javamail技术进行深入研究,提出并设计实现了基于Javamail的邮件收发系统。
本系统利用SMTP协议和POP协议从底层进行开发,利用JavaMail API为收发邮件提供与协议无关的访问。
SMTP(简单邮件传输协议)是专门用来发送邮件的。
POP (邮局协议)是专门用于接收邮件的。
JavaMail API是一种可选的、能用于读取、编写和发送电子消息的标准扩展包。
本文主要可分为四个部分。
第一部分介绍了Javamail邮件系统的意义和现状。
第二部分具体介绍了几种相关协议和Javamail API。
第三部分主要介绍了系统的开发工具JA V A语言、Eclipse及其安装过程与配置方法。
第四部分详细阐述了Javamail邮件收发系统的实现过程。
关键词:SMTP,POP,JA V AMAIL,邮件收发MAIL SYSTEM BASED ON JAVAMAILABSTRACTE-Mail play a very important role in modern times. More and more people are using it, and the number of it will larger and larger. This paper introduced the javamail system's development background, analyzed and compared some existing maturity Email system at home and abroad , summarized their advantages and disadvantages, studied deeply with the javamail technology , proposed and designed out the mail system based on javamail. This system used POP protocol and SMTP protocol to develop from the bottom, used JavaMail API to provide the visit which has nothing to do with the agreement for send and receive email. SMTP (Simple Mail Transfer Protocol) is designed to send a message. POP (Post Office Protocol) is designed to receive mail. JavaMail API is an standard expansion package which is optional, can be used to read, write and send electronic messages.This paper can be divided into four parts. The first part introduced javamail email system's significance and status. The second part introduced several related agreements and JavaMail API. The third part mainly introduced system's development tools JA V A language , Eclipse and their installation process and configuration method. The fourth part detailed javamail email system's realization process.Keywords:SMTP, POP, JA V AMAIL, Email to send and receive目录第一章绪论 (1)1.1电子邮件介绍 (1)1.2研究意义 (1)1.3研究现状 (3)第二章相关邮件协议和JavaMail API (5)2.1相关邮件协议 (5)2.2JavaMail API (6)2.2.1 JavaMail API简介 (6)2.2.2 JavaMail API核心类 (6)2.3.3 JavaMail API的应用 (8)第三章应用系统开发工具 (10)3.1Java开发语言简介 (11)3.2开发工具Eclipse (12)3.3开发软件的安装 (12)3.3.1 JA V A环境的安装与配置 (12)3.3.2 Eclipse的安装 (14)3.3.3 javamail的安装 (15)第四章JavaMail系统的实现 (16)4.1环境配置与界面搭建 (16)4.2设置邮件服务器参数的实现 (16)4.3创建与发送邮件功能的实现 (17)4.3.1 装载邮件服务器属性, 并与其建立连接 (17)4.3.2 构建邮件 (18)4.3.3 创建Transport对象发送邮件 (19)4.4接收邮件功能的实现 (19)4.4.1 获取服务器信息 (20)4.4.2 建立通信连接 (20)4.4.3显示邮件 (20)4.5删除邮件功能的实现 (22)第五章结语 (23)参考文献 (24)致谢 (25)第一章绪论本文是一项基于JavaMail的邮件系统的综合性研究,使用Sun公司提供的JavaMail API实现电子邮件的发送、电子邮件的接收等等功能。