ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 在WAP网站上建立反馈表单(转)

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

原创 Linux操作系统 作者:jcszjswkzhou 时间:2019-05-19 21:54:05 0 删除 编辑

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.

<% Response.ContentType = "text/vnd.wap.wml" %>





<!-- THIS IS THE FIRST CARD IN THE DECK -->



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]

<% Response.ContentType = "text/vnd.wap.wml" %>







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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-08-29

  • 博文量
    2772
  • 访问量
    2036879