?? sendpage.asp
字號:
<!--#include file="conn.asp"-->
<!-- #include file="inc/const.asp" -->
<!-- #include file="chkuser.asp" -->
<!-- #include file="inc/char.asp" -->
<!-- #include file="inc/email.asp" -->
<!-- #include file="inc/theme.asp" -->
<%
dim rs,sql
dim boardid
dim announceid
dim username
dim rootid
dim topic
dim mailbody
dim email
dim content
dim postname
dim incepts
dim announce
Rem ------獲取參數(shù)(get or post的)------
Rem ------包括版面的ID和頁次------
stats="發(fā)送帖子"
call chkInput()
set rs=server.createobject("adodb.recordset")
call nav()
call headline(1)
if foundErr then
call Error()
else
call showPage()
end if
call endline()
sub showPage()
'on error resume next
if foundErr then
call Error()
else
if request("action")="sendmail" then
if IsValidEmail(trim(Request.Form("mail")))=false then
errmsg=errmsg+"<br>"+"<li>您的Email有錯(cuò)誤。</li>"
founderr=true
else
email=trim(Request.Form("mail"))
end if
if request("postname")="" then
errmsg=errmsg+"<br>"+"<li>請輸入您的姓名。</li>"
founderr=true
else
postname=request("postname")
end if
if request("incept")="" then
errmsg=errmsg+"<br>"+"<li>請輸入收件人姓名。</li>"
founderr=true
else
incepts=request("incept")
end if
if request("content")="" then
errmsg=errmsg+"<br>"+"<li>郵件內(nèi)容不能為空。</li>"
founderr=true
else
content=request("content")
end if
if founderr then
call error()
else
call announceinfo()
if founderr then
call Error()
else
if EmailFlag=0 then
errmsg=errmsg+"<br>"+"<li>本論壇不支持發(fā)送郵件。</li>"
founderr=true
call error()
elseif EmailFlag=1 then
call jmail(email)
call success()
elseif EmailFlag=2 then
call Cdonts(email)
call success()
elseif EmailFlag=3 then
call aspemail(email)
call success()
end if
end if
end if
else
call pag()
end if
end if
if err.number<>0 then err.clear
end sub
sub announceinfo()
sql="select boardtype from board where boardID="&BoardID
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
boardtype=rs("boardtype")
else
foundErr = true
ErrMsg=ErrMsg+"<br>"+"<li>您指定的論壇版面不存在</li>"
exit sub
end if
rs.close
'Rs.open "Select topic from bbs1 Where announceID="&AnnounceID&"",conn,1,1
set rs=conn.execute("select topic from bbs1 where announceID="&rootID&"")
if not(rs.bof and rs.eof) then
' topic=rs("topic")
topic="您的朋友"&postname&"給您發(fā)來了一個(gè)"&ForumName&"上的貼子"
else
foundErr = true
ErrMsg=ErrMsg+"<br>"+"<li>您指定的貼子不存在</li>"
exit sub
end if
rs.close
mailbody=mailbody &"<style>A:visited { TEXT-DECORATION: none }"
mailbody=mailbody &"A:active { TEXT-DECORATION: none }"
mailbody=mailbody &"A:hover { TEXT-DECORATION: underline overline }"
mailbody=mailbody &"A:link { text-decoration: none;}"
mailbody=mailbody &"A:visited { text-decoration: none;}"
mailbody=mailbody &"A:active { TEXT-DECORATION: none;}"
mailbody=mailbody &"A:hover { TEXT-DECORATION: underline overline}"
mailbody=mailbody &"BODY { FONT-FAMILY: 宋體; FONT-SIZE: 9pt;}"
mailbody=mailbody &"TD { FONT-FAMILY: 宋體; FONT-SIZE: 9pt }</style>"
mailbody=mailbody &"<TABLE border=0 width='95%' align=center><TBODY><TR><TD>"
mailbody=mailbody &""&incepts&",您好:<br><br>"
mailbody=mailbody &"您的朋友"&postname&"給您發(fā)來了一個(gè)"&ForumName&"--"&boardtype&"上的貼子<BR><br>"
mailbody=mailbody &"標(biāo)題是:"&htmlencode(topic)&"<br><br>"
mailbody=mailbody &""&htmlencode(content)&"<br><br>"
mailbody=mailbody &"您可以到<a href=http://www.aspsky.net/club/dispbbs.asp?boardid="&boardid&"&rootid="&rootid&"&id="&Announceid&">"&topic&"</a>這里瀏覽這個(gè)貼子<br>"
mailbody=mailbody &"<p align=center>"&ads2&"<br>"
mailbody=mailbody &""&Copyright&" "&Version&""
mailbody=mailbody &"</TD></TR></TBODY></TABLE>"
' response.write mailbody
' mailbody=""
end sub
sub pag()
%>
<table cellpadding=0 cellspacing=0 border=0 width="<%=tablewidth%>" bgcolor=<%=tablebackcolor%> align=center>
<tr>
<td>
<table cellpadding=6 cellspacing=1 border=0 width=100%>
<form action="sendpage.asp?action=sendmail&boardid=<%=boardid%>&rootid=<%=rootid%>&id=<%=announceid%>" method=post>
<tr>
<td bgcolor=<%=tabletitlecolor%> valign=middle colspan=2 align=center><font color="<%=TablefontColor%>">
<b>發(fā)送郵件給朋友</b></font></td></tr>
<tr>
<td bgcolor=<%=tablebodycolor%> valign=middle colspan=2><font color="<%=TableContentColor%>">
<b>通過郵件發(fā)送本帖子給您的朋友。</b> 下列所有項(xiàng)必填,并請輸入正確的郵件地址!
<br>你可以添加一些自己的信息在下面的內(nèi)容框內(nèi)。至于這個(gè)帖子的主題和 URL 你可以不必寫,因?yàn)楸境绦驎?huì)在發(fā)送的 Email 中自動(dòng)添加的!</font>
</td></tr>
<tr>
<td bgcolor=<%=tablebodycolor%>><font color="<%=TableContentColor%>"><b>您的姓名:</b></font></td>
<td bgcolor=<%=tablebodycolor%>><input type=text size=40 name="postname"></td>
</tr><tr>
<td bgcolor=<%=atablebodycolor%>><font color="<%=TableContentColor%>"><b>您朋友的名字:</b></font></td>
<td bgcolor=<%=atablebodycolor%>><input type=text size=40 name="incept"></td>
</tr><tr>
<td bgcolor=<%=tablebodycolor%>><font color="<%=TableContentColor%>"><b>您朋友的 Email:</b></font></td>
<td bgcolor=<%=tablebodycolor%>><input type=text size=40 name="mail"></td>
</tr><tr>
<td bgcolor=<%=atablebodycolor%>><font color="<%=TableContentColor%>"><b>消息內(nèi)容:</b></font></td>
<td bgcolor=<%=atablebodycolor%>><textarea name="content" cols="55" rows="6">我想你對 '<%=ForumName%>' 的這個(gè)帖子內(nèi)容會(huì)感興趣的!請去看看!</textarea></td>
</tr><tr>
<td colspan=2 bgcolor=<%=tabletitlecolor%> align=center><input type=submit value="發(fā) 送" name="Submit"></table></td></form></tr></table>
<%
end sub
sub chkInput
if request("boardid")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>請指定論壇版面。"
elseif not isInteger(request("boardid")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的版面參數(shù)。"
else
boardid=request("boardid")
end if
if request("id")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>請指定相關(guān)貼子。"
elseif not isInteger(request("id")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的貼子參數(shù)。"
else
AnnounceID=request("id")
end if
if request("RootID")="" then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>請指定相關(guān)貼子。"
elseif not isInteger(request("RootID")) then
founderr=true
Errmsg=Errmsg+"<br>"+"<li>非法的貼子參數(shù)。"
else
RootID=request("RootID")
end if
end sub
sub success()
%>
<table cellpadding=0 cellspacing=0 border=0 width="95%" bgcolor=<%=tablebackcolor%> align=center>
<tr>
<td>
<table cellpadding=3 cellspacing=1 border=0 width=100%>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>><font color="<%=TablefontColor%>">成功:發(fā)送頁面</font></td>
</tr>
<tr>
<td width="100%" bgcolor=<%=tablebodycolor%>><font color="<%=TableContentColor%>">恭喜您,您的頁面發(fā)送成功。</font>
</td>
</tr>
<tr align="center">
<td width="100%" bgcolor=<%=tabletitlecolor%>>
<a href="javascript:history.go(-1)"><font color="<%=TablefontColor%>"> << 返回上一頁</font></a>
</td>
</tr>
</table> </td></tr></table>
<%
end sub
set rs=nothing
stats="發(fā)送頁面"
%>
<!--#include file="footer.asp"-->
</BODY></HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -