分类分类
关注+2004-11-07作者:蓝点
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 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">
Your Feedback
Please enter your email address
Please enter your feedback
<postfield name="txtFrom"
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.
<% 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").
相关文章
更多+相同厂商
热门推荐
点击查看更多
点击查看更多
点击查看更多
说两句网友评论