我在想是写一个笔记呢还是写两个呢,我想来想去,还是写成两个吧,以后看的时候也比较方便一点.
第一个如题所示,整理一个发送邮件的方法.
在网上查了很多方式,最后发现了一个不错的小jar包,调试过程中遇到的一些问题通过各种查找资料也解决啦,嘻嘻
在网上大神们的帮助下,终于查到一个发送邮件的不错的jar包:
commons-email-1.1.jar;配合它使用的是mail.jar和activation.jar.这三个是必须的哟.
之后开始程序,其实挺简单的:
按理说,这样的话,就应该能发送了,但是
在Java EE 5环境下遇到异常:Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream<wbr></wbr>
这个问题是因为jar包冲突了,查了网上好多解决的办法是去掉myeclipse的j2ee下的mail目录,一般提供的目录是:D:\Program Files\MyEclipse 5.5 GA\myeclipse\eclipse\plugins\com.genuitec.eclipse.j2eedt.core_5.5.0\data\libraryset\EE_5.
同样我也遇到了这样的问题,但是,我用的版本是myeclipse8.5,找了老长时间都没有找到这个路径,晕死...
后来想起chyxion说过的myeclipse的强大功能,那就是查找功能,既然我不知道路径在哪,那就用myeclipse查找吧,哈哈~查什么呢,既然都是引入的包,不妨查一下"library",在myeclipse中,选择"window"--"preferences",然后在框里输入"library",
well,还真的出来了呢:
点击"add JAR/ZIP"后,就看到路径啦:
然后就是按照网上说的,用rar打开这个jar包,删除掉mail文件夹就可以啦.
ps:不能忘记,删除myeclipse的struts2中默认引入的系统核心包其中的一个也是这种方法呢,哼哼哼~
另外附上官网的东东:http://commons.apache.org/email/userguide.html
分享到:
相关推荐
该模型由乐高团队(SIT NUM)在2010年秋季开发。团队成员:Davaadorj,Munkhdul,Khuyagbaatar
校友骨干客户校友骨干应用程序原型。
校友API 这是校友的原型api,用node编写。
校友校友 Django 项目
db_lovenios_alumnus.sql
go_alumnus
校友录管理系统(ARMS:Alumnus Record Management System)用于个人用户进行校友信息的管理,要求完成的主要的功能有录入、修改、删除、查询、排序校友信息。可以完成密码登录系统、按不同名录查找信息、按姓名或届...
An alumnus of the University of North Carolina and New York University, he lives in Brooklyn with his wife and cat. Table of Contents The Fundamentals of Machine Learning Simple linear regression ...
An alumnus of the University of North Carolina and New York University, he lives in Brooklyn with his wife and cat. Contents Chapter 1. The Fundamentals of Machine Learning Chapter 2. Simple linear ...
Ashish Kumar is an IIM alumnus and an engineer at heart. He has extensive experience in data science, machine learning, and natural language processing having worked at organizations, such as McAfee-...
Ashish Kumar is an IIM alumnus and an engineer at heart. He has extensive experience in data science, machine learning, and natural language processing having worked at organizations, such as McAfee-...
Caltech PS sample更多模板:http://alumnus.caltech.edu/~natalia/studyinus/guide/statem
Clark Lay, are all distinguished mathematicians, and in 1989 they jointly received the Outstanding Alumnus award from their alma mater, Aurora University. In 2006, Steven was honored to receive the ...
Some teachers are not allowed to put their PPTs on the Internet, so please don't spread them everywhere.The only reason for this Repository's existence is helping alumnus to make preview and review ...