首页 > 编程 > JSP > 正文

如何使用JSP来发 送邮件

2019-11-02 15:45:54
字体:
来源:转载
供稿:网友

MESSAGE.JSP

<TABLE width=555 border=0 align="center" cellPadding=0 cellSpacing=0>
<FORM action=message_do.jsp method=post>
<TBODY>
<TR>
<TD width=80 height=30>信件标题:<FONT color=#ff0000>*</FONT></TD>
<TD><INPUT class=input id=topic name=topic>
</TD>
</TR>
<TR>
<TD width=80 height=23 valign="top">反馈信息:<FONT color=#ff0000>*</FONT></TD>
<TD><TEXTAREA class=input id=body name=body rows=5 cols="50"></TEXTAREA>
</TD>
</TR>
<TR>
<TD width=80 height=30>如何称呼:<FONT color=#ff0000>*</FONT></TD>
<TD><INPUT class=input id=name name=name>
</TD>
</TR>
<TR>
<TD width=80 height=30>你的邮件:<FONT color=#ff0000>* </FONT></TD>
<TD height=23><INPUT class=input id=email name=email>
</TD>
</TR>
<TR>
<TD width=80 height=30>你的电话:</TD>
<TD><INPUT name=phone class=input id="phone">
</TD>
</TR>
<TR>
<TD width=80 height=45>公司地址:<BR>
(或网址)</TD>
<TD><INPUT class=input id=http size=40 name=http>
</TD>
</TR>
<TR>
<TD align=right width=80>&nbsp;</TD>
<TD height=35><INPUT class=bt type=submit value=提交 name=tt onclick="return check()">
</TD>
</TR>
</FORM>
</TABLE>

处理页面:

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.util.*,javax.mail.*,cn.cmpy.company.*,javax.mail.internet.*,javax.activation.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:useBean id="company" scope=&

好看的邪恶搞笑漫画[www.62-6.com/1/manhua/]
quot;page" class="cn.cmpy.company.company"></jsp:useBean>
<jsp:useBean id="comCtl" scope="page" class="cn.cmpy.company.comCtl"></jsp:useBean>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言本发送</title>
</head>
<body>

<%
//int id=1;
company=comCtl.selectCompany(1);
String email1="";
email1=company.getEmail();
if(email1==null) email1="[email protected]";

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表