<%@ page contentType="text/html;charset=GBK" %>
<html>
<head>
<title>发送带附件的电子邮件</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<jsp:useBean id="mail" scope="page" class="myBean.mail.MailManager" />
<%
	String email = request.getParameter("email");
	if(email==null || email.trim().length()==0||!email.matches("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$")) {
		out.print("邮件地址为空");
		return;
	}
	
	String []files = new String[]{"e:\\readCookies.htm", "e:\\addCookies.htm", "e:\\prt.xml"};
		String content = "<html><head><title>测试JavaMail</title></head><body><h1>Welcome to javaMail</h1></body></html>";
		mail.sendMailWithAttachment(email, "JavaMail with attachment", "Welcome to javaMail", "smtpuser@xxx.com", "text/html", files);
	out.print("邮件已发送");
%>
</body>
</html>