%@ LANGUAGE="VBSCRIPT" %>
<%
dim rs,sql
dim boardtype
dim boardid
dim announceid
dim username
dim rootid
dim topic
dim mailbody
dim email
dim content
dim postname
dim incepts
dim announce
Rem ------获取参数(get or post的)------
Rem ------包括版面的ID和页次------
stats="发送帖子"
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+"
"+"
您的Email有错误。"
founderr=true
else
email=trim(Request.Form("mail"))
end if
if request("postname")="" then
errmsg=errmsg+"
"+"请输入您的姓名。"
founderr=true
else
postname=request("postname")
end if
if request("incept")="" then
errmsg=errmsg+"
"+"请输入收件人姓名。"
founderr=true
else
incepts=request("incept")
end if
if request("content")="" then
errmsg=errmsg+"
"+"邮件内容不能为空。"
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+"
"+"本论坛不支持发送邮件。"
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+"
"+"您指定的论坛版面不存在"
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&"给您发来了一个"&ForumName&"上的贴子"
else
foundErr = true
ErrMsg=ErrMsg+"
"+"您指定的贴子不存在"
exit sub
end if
rs.close
mailbody=mailbody &""
mailbody=mailbody &""
mailbody=mailbody &""&incepts&",您好:
"
mailbody=mailbody &"您的朋友"&postname&"给您发来了一个"&ForumName&"--"&boardtype&"上的贴子
"
mailbody=mailbody &"标题是:"&htmlencode(topic)&"
"
mailbody=mailbody &""&htmlencode(content)&"
"
mailbody=mailbody &"您可以到"&topic&"这里浏览这个贴子 "
mailbody=mailbody &""&ads2&" "
mailbody=mailbody &""&Copyright&" "&Version&""
mailbody=mailbody &" |
"
' response.write mailbody
' mailbody=""
end sub
sub pag()
%>
<%
end sub
sub chkInput
if request("boardid")="" then
founderr=true
Errmsg=Errmsg+"
"+"请指定论坛版面。"
elseif not isInteger(request("boardid")) then
founderr=true
Errmsg=Errmsg+"
"+"非法的版面参数。"
else
boardid=request("boardid")
end if
if request("id")="" then
founderr=true
Errmsg=Errmsg+"
"+"请指定相关贴子。"
elseif not isInteger(request("id")) then
founderr=true
Errmsg=Errmsg+"
"+"非法的贴子参数。"
else
AnnounceID=request("id")
end if
if request("RootID")="" then
founderr=true
Errmsg=Errmsg+"
"+"请指定相关贴子。"
elseif not isInteger(request("RootID")) then
founderr=true
Errmsg=Errmsg+"
"+"非法的贴子参数。"
else
RootID=request("RootID")
end if
end sub
sub success()
%>
<%
end sub
set rs=nothing
stats="发送页面"
%>