首页 > Linux操作系统 > Linux操作系统 > 在WAP网站上建立反馈表单(转)
For any one person to create a web site and then think it is perfect, is ridiculous. It is important to Your Feedback Please enter your email address Your Feedback Mail has been sent... Mail send failure. Error was " & Mailer.Response &"
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 -->
Please enter your feedback
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" %>
<%
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 "
else
Response.Write "
end if
%>
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博客 ” ,链接:https://blog.itpub.net/10294527/viewspace-125337/ ,如需转载,请注明出处,否则将追究法律责任。