JAVAMAIL的问题,菜鸟求助

hzgaofei 2006-08-24 06:08:20
<%@ page language="java" contentType="text/html;charset=GBK" %>
<%@ page import="java.util.*"%>
<%@ page import="javax.mail.*"%>
<%@ page import="javax.mail.internet.*"%>
<html>
<head>
<title>数据导入操作</title>
<link href="/css/default.css" rel=stylesheet>

</head>

<%
Properties props = new Properties();
props.put("mail.smtp.auth", "true"); //这样才能通过验证
props.put("mail.smtp.host", "smtp.sina.com.cn");
Session ssion = Session.getDefaultInstance(props);
ssion.setDebug(true);
MimeMessage message = new MimeMessage(ssion);
message.setFrom(new InternetAddress("xx@sina.com"));
message.addRecipient(Message.RecipientType.TO,new InternetAddress("gaofei@landpage.com.cn"));
message.setSubject("这是测试标题");
message.setText("这是测试正文");
message.saveChanges();
Transport transport = ssion.getTransport("smtp");
transport.connect("smtp.sina.com.cn","xx","passwd");
transport.sendMessage(message, message.getAllRecipients());
transport.close();
%>

怎么出错:

java.lang.NoClassDefFoundError: javax/activation/DataSource
at _mail__jsp._jspService(/mail.jsp:18)
at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
at com.caucho.jsp.Page.subservice(Page.java:506)
at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
at com.caucho.server.http.Invocation.service(Invocation.java:315)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:246)
at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:595)

请求帮助
...全文
69 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
warran21 2006-09-04
  • 打赏
  • 举报
回复
没有找到类
是不是你没有将你的mail.jar复制到lib下,或者复制后没有重启服务器。
zhmt 2006-08-25
  • 打赏
  • 举报
回复
路过,友情up...
lanlanq 2006-08-25
  • 打赏
  • 举报
回复
没有发现类

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧