(4)完整的留言板程序代码
<%
Dim sKind,sName,sSex,sFrom,STo,sSubject,sBody
Dim CDOMail,Title,Message
NL=CHR(13)+CHR(10) '换行字符
sFrom=Request(“From”)
sName=Request(“Name”)
sTo=“wangfm@qvtc.cc”
sSubject=“[留言板]”+Request(“Subject”)
sBody=Request(“Body”)
sSex=Request(“Sex”)
If sSex=“0” Then
Title=“小姐”
Else
Title=“先生”
End If
Message=“姓名”+sName+Title+NL
Message=Message+”时间:”& Now & NL
Message=Message+”-----------------”+NL
Message=Message+sBody+NL
Message=Message+”-----------------”+NL
Message=Message+”IP地址:”+Request(“REMOTE_ADDR”)+NL
Message=Message+”相关信息:”+Request(“HTTP.USER_AGENT”)
Set CDOMail=Server,CreateObject(“CDONTS,NewMail”)
CDOMail.From=sFrom
CDOMail.To=sTo
CDOMail.Subject=sSubject
CDOMail.Body=Message
CDOMail.Send
Set CDOMail=Nothing
%>
<Html>
<Head><Title>留言板</Title></Head>
<Body>
<Br>
<BlockQuote>
<P>欢迎留言,我们收到信息后会尽快与您联系谢谢!</P>
发件人,<%=sName%><%=Title%><%=sFrom%><Br>
收件人,<%=sTo%><Br>
时间,<%=Now%><Br>
=====================================
<Pre><%=Request(,REMOTE_ADDR” ) % ></Pre>
=====================================
<Br>
IP地址:<%=Request(“REMOTE_ADDR”)%><Br>
相关信息:<%=Request(“HTTP_USER_AGENT”)%>
</BlockQuote>
</Body>
</Html>