JavaMail运行

来源:百度知道 编辑:UC知道 时间:2024/06/03 20:32:32
在web\WEB-INF\lib下放置了activation.jar和mail.jar,但是在运行一下程序是仍然报错。
<%@page contentType="text/html"%>
<%@page pageEncoding="GB2312"%>
<%@ page import="java.util.*,java.io.*" %>
<%@ page import="javax.mail.*" %>
<%@ page import="javax.mail.internet.*" %>
<%@ page import="javax.activation.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>

<h1>JSP Page</h1>
<%
Properties theproperties = System.getProperties();
theproperties.put("mail.host","127.0.0.1");
theproperties.put("mail.transport.protocol","smtp");

Session thesession = Session.getDefaultInstan

把错误信息贴出来看一下啊

已经发到你邮箱了,看一下吧!

程序没有问题
127.0.0.1
至少得改成
smtp.163.com
才行

贴错误信息,贴好以后我改回复。