日期:2014-05-17 浏览次数:20836 次
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>Test页面</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
<form action="toMail.action" method="post" encType="multipart/form-data" >
<table cellspacing="2" cellpadding="2" align="center" border="0">
<tr>
<td style="width:15%">接 收 人:</td>
<td><input name="mailReciver" type="text" id="mailReciver" style="width:80%" maxlength=255 /></td>
</tr>
<tr>
<td style="width:15%">发 送 人:</td>
<td><input name="mailSender" type="text" id="mailSender" style="width:80%" maxlength=255 /></td>
</tr>
<tr>
<td style="width:15%">主 题:</td>
<td><input name="mailSubject" type="text" id="title" style="width:80%" maxlength=255 /></td>
</tr>
<tr>
<td width="15%"><input type="text" name="mailContent" style="width:80%" maxlength=255 /></td>
<td><input type="file" name="attachFileNames" /></td>
</tr>
<tr>
<td align="center" width="60%"><input type="submit" value="发送" class="button" /></td>
</tr>
</table>
</form>
</body>
</html>
//发送附件
for (String fileName : smail.getAttachFileNames()) {
mailMessage.addAttachment(MimeUtility.encodeWord(fileName), new File(fileName));
}