javamail测试一直失败..

来源:百度知道 编辑:UC知道 时间:2024/06/20 23:44:07
====jsp============
http://topic.csdn.net/t/20050816/15/4211980.html
的8楼位置
========tomcat提示:=================
2008-11-30 14:45:14 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 58 in the jsp file: /testall.jsp
Session cannot be resolved to a type
55: Properties props=new Properties();
56: props.put("mail.smtp.host",smtptype);
57: props.put("mail.smtp.auth","true");
58: Session s=Session.getInstance(props);
59: s.setDebug(true);
60:
61: MimeMessage message=new MimeMessage(s);

MimeMessage cannot be resolved to a type
MimeMessage cannot be reso

//建立邮件会话
Properties props=new Properties();//也可用Properties props = System.getProperties();
props.put("mail.smtp.host","163.com ");//存储发送邮件服务器的信息
props.put("mail.smtp.auth","true");//同时通过验证
Session s=Session.getInstance(props);//根据属性新建一个邮件会话
s.setDebug(true);