在WAP网站上建立反馈表单
|
A feedback form is developed by first creating the form, in this case to capture the end-user"s comments, First we create the feedback form itself. Please remember to change the red capital letters within the <% 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" <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 <% 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 源代码网供稿. |
