a feedback form is developed by first creating the form, in this case to capture the end-user's comments,
and second to create the sendmail code, which will be used to send the comments via e-mail to us. as
always if you have any other problems with asp/wml then you can e-mail me at michael_wright@lineone.net.
also if you are a company supervisor, manager or director i am always looking for work, whether it be
working remotely or on-location. please feel free to e-mail the same address.
first we create the feedback form itself. please remember to change the red capital letters within the
code.
<% response.contenttype = "text/vnd.wap.wml" %><?xml version="1.0"?>
<!doctype wml public "-//wapforum//dtd wml 1.1//en" "http://www.wapforum.org/dtd/wml_1.1.xml">
<wml>
<!-- this is the first card in the deck -->
<card id="maincard">
<p align="left"><small><b>your feedback</b></small></p>
<p align="left">please enter your email address <input type="text" name="txtfrom" format="*m"/>
please enter your feedback <input type="text" name="txtmessage" format="*m"/></p>
<do type="accept" label="submit!"><go href="email.asp" method="post"><postfield name="txtfrom"
value="$txtfrom"/><postfield name="txtmessage" value="$txtmessage"/></go></do>
<p align="left"><small><a href="location of your main wap page">back</a></small></p>
</card>
</wml>
now save that code as a file called feedback.asp. then we must create the sendmail code. this sendmail
code can only be used if you have the aspmail component installed on your web server. it is possible to
simply change the asp code in conjunction with your own component e.g. cdonts.[page]
<% response.contenttype = "text/vnd.wap.wml" %><?xml version="1.0"?>
<!doctype wml public "-//wapforum//dtd wml1.1//en" "http://www.wapforum.org/dtd/wml_1.1.xml">
<wml>
<card id="maincard" title="send feedback">
<p><small><b>your feedback</b></small></p>
<%
sstrtoname = "your name"
sstrtoaddr = "your email address"
set mailer = createobject("smtpsvg.mailer")
mailer.remotehost = "smtp mail server"
mailer.fromaddress = request.form("txtfrom")
mailer.addrecipient sstrtoname, sstrtoaddr
mailer.subject = "subject of feedback email"
mailer.bodytext = request.form("txtmessage")
if mailer.sendmail then
response.write "<p><small>mail has been sent...</small></p>"
else
response.write "<p><small>mail send failure. error was " & mailer.response &"</small></p>"
end if
%>
<p align="left"><small><a href="location of your main wap page">back to menu</a></small></p>
</card>
</wml>
now save that code as a file called email.asp and you are ready to test it. i hope you found this article
helpful. one of the main problems i had when creating this code was the way in which the wap input is
recognised by the asp code i.e. you must either use request.form("txtfrom") or request.querystring
("txtfrom") and not just request("txtform").
| 以下内容为程序代码: <script src="/ad/news5.js"> </script> |
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器