在WAP网站上建立反馈表单(转)

网站反馈表单的创建
文章强调网站应允许访客评论,以便从终端用户处学习并提升整体效果,还可将此应用于WAP站点。介绍了开发反馈表单的方法,先创建表单收集用户评论,再编写SendMail代码通过邮件发送评论,同时给出了相关代码示例。

For any one person to create a web site and then think it is perfect, is ridiculous. It is important to
allow the visitors of our web sites to comment on what we have developed so that we can learn from the end-
user, our mistakes and not to mention the overall effectiveness. We create these facilities for web sites
so why not create them for our WAP sites.

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.

<?xml version="1.0"?>





<!-- THIS IS THE FIRST CARD IN THE DECK --&gt



Your Feedback



Please enter your email address

Please enter your feedback



value="$txtFrom"/>

Back







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]

<?xml version="1.0"?>







Your Feedback




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 "

Mail has been sent...

"

else

Response.Write "

Mail send failure. Error was " & Mailer.Response &"

"

end if

%>

Back to Menu







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").

以下内容为程序代码:

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10294527/viewspace-125337/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10294527/viewspace-125337/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值