<%@ page contentType="text/html;charset=GB2312" language="java" %>
<%@ page import="net.jspcn.util.SendMail" %>
<%@ include file = "func/parameter.jsp" %>

<%
if (Integer.parseInt((String) session.getValue("user_power"))<9999)
response.sendRedirect("login.jsp");


    if(request.getMethod().equals("POST")) {
    SendMail mail = new SendMail();
    mail.setHost("smtp.163.net");
    mail.setUser("webmastert");
    mail.setPassword("123456!@#$%^");
    mail.setFrom(request.getParameter("from"));
    mail.setTo(request.getParameter("to"));
    mail.setCc(request.getParameter("cc"));
    mail.setBcc(request.getParameter("bcc"));
    mail.setSubject(request.getParameter("subject"));
    mail.setContent(request.getParameter("content"));
    mail.setFileAttachment(request.getParameter("filename"));
    mail.send();

    out.println("Success");
    }
%>

<%@ include file = "func/header.jsp" %>
<BODY align="center">
<FORM action="sendmail.jsp" method="post">
<TABLE align="left" width="90%" border="0">
<TR>
	<TD width="15%" align="left">收件人:</td>
	<td width="85%" align="left"><INPUT name="to" size="50" class="input"></TD>
</TR>
<TR>
	<TD width="15%" align="left">寄信人:</td>
	<td width="85%" align="left"><INPUT name="from" size="50" class="input"></TD>
</TR>
<TR>
	<TD width="15%" align="left">抄 送:</td>
	<td width="85%" align="left"><INPUT name="cc" size="50" class="input"></TD>
</TR>
<TR>
	<TD width="15%" align="left">密 送:</td>
	<td width="85%" align="left"><INPUT name="bcc" size="50" class="input"></TD>
</TR>
<TR>
	<TD width="15%" align="left">主 题:</td>
	<td width="85%" align="left"><INPUT name="subject" size="50" class="input"></TD>
</TR>

<TR>
	<TD width="15%" align="left">正 文:</td>
	<td width="85%" align="left"><TEXTAREA name="content" rows=20 cols=45 class="textare"></TEXTAREA></TD>
</TR>

<TR>
	<TD width="15%" align="left">附 件:</td>
	<td width="85%" align="left"><input type="file" name="filename" class="button"></TD>
</TR>

<TR>
	<TD width="15%" align="right" height="40">&nbsp;</td>
	<td width="85%" align="left"><INPUT type="submit" name="cb_submit" size="40" class="button" value="发送">&nbsp;&nbsp;&nbsp;&nbsp;<INPUT type="reset" name="cb_reset" class="button" value="重写"></TD>
</TR>
</TABLE>
</FORM>

<%@ include file = "func/footer.jsp" %>                                                                              