?? 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 + -