jsp的技术教程
源代码在线查看: compose.jsp
String addresser,recipients,subject,content,mailserver;
addresser=request.getParameter("addresser");
recipients=request.getParameter("recipients");
subject=request.getParameter("subject");
content=request.getParameter("content");
mailserver=request.getParameter("mailserver");
try
{
SmtpClient host=new SmtpClient(mailserver);
host.from(addresser);
host.to(recipients);
PrintStream MailMessage=host.startMessage();
MailMessage.println("收件人地址:"+recipients);
MailMessage.println("主题:"+subject);
MailMessage.println("内容:"+content);
MailMessage.println("发信人地址:"+addresser);
MailMessage.println("邮件服务器:"+mailserver);
host.closeServer();
out.println("成功发送");
}
catch(IOException e)
{
out.println(e.getMessage());
}
%>