📄 sendmessages.asp
字号:
<title>信息反馈表</title>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="style_article.css" rel="stylesheet" type="text/css">
<!-- #include file="conn.asp" -->
<!--#include file="inc/CHAR.asp"-->
<body leftmargin="0" topmargin="2">
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td bgcolor="#8BCE00"> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#333333">
<tr>
<td align="center" bgcolor="#FFFFFF">
<% dim SendMail
select case request("action")
case "savesend"
call savesend()
case "sendreply"
call sendreply()
case "replay"
call reply()
case "read"
call read()
case else
call main()
end select
sub savesend()
if Trim(Request.Form("UserName"))<>"" and Trim(Request.Form("Title"))<>"" and Trim(Request.Form("Email"))<>"" and Trim(Request.Form("Content"))<>"" then
set rs=server.createobject("adodb.recordset")
sql="select * from SoftDown_Message where (ID is null)"
rs.open sql,conn,1,3
rs.addnew
rs("Title")=checkstr(Trim(request.form("Title")))
rs("Content")=Request.Form("content")
rs("UserName")=Trim(Request.Form("UserName"))
rs("Email")=Trim(Request.Form("Email"))
rs("DateTime")=Now()
rs("isRead")=0
rs.update
rs.close
set rs=nothing
Response.Write("<br><br>您的反馈信息已经成功提交,您可以关闭这个窗口!<br><br>")
else
Response.Write("<br><br>Sorry!您没有把信息填写完整,操作失败!<br><br>")
end if
end sub
sub sendreply()
email=Trim(Request.Form("Email"))
topic=Trim(Request.Form("Title"))
mailbody=Trim(Request.Form("Content"))
call Jmail(email,topic,mailbody)
if SendMail="OK" then
Response.Write("发送成功!")
else
Response.Write("发送失败!")
end if
end sub
sub main()
Set Rs=server.createobject("adodb.recordset")
dim strTitle
sql="select SoftID,SoftName,SoftVer from SoftDown_SoftInfo where SoftID="&Trim(Request.QueryString("SoftID"))
rs.open sql,conn,1,1
if rs.eof and rs.bof then
strTitle=""
else
strTitle="软件:("&rs(0)&")"&rs(1)&" "&rs(2)&" 的错误报告"
end if
Set Rs=nothing
%>
<table width="100%" border="0" cellspacing="2" cellpadding="5">
<form action="SendMessages.asp" method="post" name="myform">
<tr bgcolor="#E7F1AB">
<td colspan="2" align="center"><font color="#FF0000"><strong>下载系统信息反馈表
<input name="action" type="hidden" id="action" value="savesend">
</strong></font></td>
</tr>
<tr bgcolor="#FBFBF4">
<td>主 题:</td>
<td> <input name="title" type="text" id="title" value="<%= strTitle %>" size="50" maxlength="200"></td>
</tr>
<tr bgcolor="#FBFBF4">
<td>发 件 人:</td>
<td> <input name="UserName" type="text" id="UserName" size="30" maxlength="30">
您的姓名或者昵称</td>
</tr>
<tr bgcolor="#FBFBF4">
<td>你的邮箱:</td>
<td> <input name="Email" type="text" id="Email" size="30" maxlength="30">
接收管理员回复信件</td>
</tr>
<tr bgcolor="#FBFBF4">
<td>反馈内容:</td>
<td> <textarea name="content" cols="48" rows="7" id="content"></textarea></td>
</tr>
<tr bgcolor="#FBFBF4">
<td> </td>
<td> <input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重写"></td>
</tr>
</form>
</table>
<%
end sub
sub read()
Set Rs=server.createobject("adodb.recordset")
sql="select * from SoftDown_Message where ID="&Trim(Request.QueryString("ID"))
rs.open sql,conn,1,1
if Not(rs.eof and rs.bof) then
%>
<table width="100%" border="0" cellspacing="2" cellpadding="5">
<tr bgcolor="#E7F1AB">
<td colspan="2" align="center"><font color="#FF0000"><strong>浏览反馈信息
</strong></font></td>
</tr>
<tr bgcolor="#FBFBF4">
<td width="60">主 题:</td>
<td><%= rs("Title") %></td>
</tr>
<tr bgcolor="#FBFBF4">
<td width="60">发件人:</td>
<td><%= rs("UserName") %></td>
</tr>
<tr bgcolor="#FBFBF4">
<td width="60">邮 箱:</td>
<td><%= rs("Email") %></td>
</tr>
<tr bgcolor="#FBFBF4">
<td width="60">反馈内容:</td>
<td><%= UBBCode(rs("Content")) %></td>
</tr>
<tr bgcolor="#FBFBF4">
<td colspan="2" align="center"><a href="?action=replay&ID=<%= Trim(Request.QueryString("ID")) %>">回
复</a></td>
</tr>
</table>
<%
end if
rs.close
set rs=nothing
end sub
sub reply()
Set Rs=server.createobject("adodb.recordset")
dim strTitle
sql="select ID,Title,UserName,Email from SoftDown_Message where ID="&Trim(Request.QueryString("ID"))
rs.open sql,conn,1,1
if not(rs.eof and rs.bof) then
%>
<table width="100%" border="0" cellspacing="2" cellpadding="5">
<form action="SendMessages.asp" method="post" name="myform">
<tr bgcolor="#E7F1AB">
<td colspan="2" align="center"><font color="#FF0000"><strong>管理员回复表
<input name="action" type="hidden" id="action" value="sendreply">
</strong></font></td>
</tr>
<tr bgcolor="#FBFBF4">
<td>主 题:</td>
<td> <input name="title" type="text" id="title" value="Re:“<%= rs("Title") %>”" size="50" maxlength="200"></td>
</tr>
<tr bgcolor="#FBFBF4">
<td>收件人:</td>
<td><input name="Email" type="text" id="Email" value="<% =rs("Email") %>" size="30" maxlength="50"></td>
</tr>
<tr bgcolor="#FBFBF4">
<td>回复内容:</td>
<td> <textarea name="content" cols="48" rows="7" id="content"><% Response.Write rs("UserName")&" 您好!"& vbcrlf %></textarea></td>
</tr>
<tr bgcolor="#FBFBF4">
<td> </td>
<td> <input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重写"></td>
</tr>
</form>
</table>
<%
end if
Set Rs=nothing
end sub
CloseDatabase %>
</td>
</tr>
</table></td>
</tr>
</table>
<% sub Jmail(email,topic,mailbody)
Dim JMail
Set JMail = Server.CreateObject("JMail.Message")
JMail.Charset = "gb2312" ' 邮件字符集,默认为"US-ASCII"
' JMail.ISOEncodeHeaders = False ' 是否进行ISO编码,默认为True
' 发送者信息(可用变量方式赋值)
JMail.From = "webmaster@mail.tzptt.zj.cn" ' 发送者邮箱
JMail.FromName = "管理员" ' 发送者姓名
JMail.Subject = topic ' 邮件主题
' 身份验证
'JMail.MailServerUserName = "user" ' 身份验证的用户名
'JMail.MailServerPassword = "password" ' 身份验证的密码
' 设置优先级,范围从1到5,越大的优先级越高,3为普通
JMail.Priority = 3
JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
' 加入一个收件人【变量email:收件人地址】可以同一语句重复加入多个
JMail.AddRecipient(email)
' 邮件主体(HTML(注意信件内链接附件的方式))
JMail.HTMLBody = UBBCode(mailbody)
JMail.Body = HTMLDecode(UBBCode(mailbody))
' 发送【调用格式:objJMail.Send([username:password@]SMTPServerAddress[:Port])】
'JMail.Send("user:password@smtp.21cn.com")
SendInfo=JMail.Send("webmaster:h6twq@mail.mesky.net")
' 关闭并清除对象
JMail.Close()
Set JMail = Nothing
if not SenInfo then
SendMail="OK"
else
SendMail="NO"
end if
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -