package demo;
import javax.servlet.*;
import javax.servlet.http.*;
import com.trulytech.mantis.system.*;
import com.trulytech.mantis.result.*;
import com.trulytech.mantis.util.Mail;
import java.sql.Statement;
/**
* <p>
* Title: CSVServlet
* </p>
* <p>
* Description:生成CSV文件
* </p>
* <p>
* Copyright: Copyright (c) 2002
* </p>
* <p>
* Company:
* </p>
*
* @author Wang Xian
* @version 1.2
*/
public class MailServlet extends ActionServlet {
/**
* 执行doPost操作
*
* @return String
* @param request
* 请求
* @param response
* response
* @param Parser
* SQL解析器
* @throws Exception
*/
protected String PerformPost(HttpServletRequest request,
HttpServletResponse response, SQLParser Parser) throws Exception
{
Mail mail = new Mail();
mail.setFrom(getParameter(request, "from"));
mail.setTo(getParameter(request, "to"));
mail.setMsg(getParameter(request, "msg"));
mail.setSubject(getParameter(request, "subject"));
mail.setContentType("text/html;charset=gb2312");
mail.sendMsgMail();
request.setAttribute("Info", "发送成功!");
return "success.jsp";
}
// 重载身份校验函数
protected int HasPermission(HttpServletRequest request,
HttpServletResponse response, SQLParser Parser) throws Exception {
return Permission.ALLOW;
}
}