With the increasing number of mobile phone users, WAP sites such as springing up quickly, mobile phone mailboxes are constantly appearing in front of people, the author has developed a set of mobile phone mailbox system, but because of time and then have been busy working things, system function has not been strengthened, Today, with the help of IT168 original network open out, and everyone to share, I hope we can exaggerated, strengthen the system function, can be better applied in practice.
Test software: Opera m3gate
Test model: eg730+ Nokia 6681 Moto v3i
Mail component: W3 jmail 4.4
Introduction of WML structure
First of all, we first make a simple introduction to the structure of WML, so that we can better browse the source.
〈?xml version="1.0"?〉
〈!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1xml"〉
〈wml〉
〈head〉
〈access/〉
〈meta..../〉
〈/head〉
〈card〉
Some contents...
〈/card〉
〈wml〉
We give the simplest example based on the above structure:
〈% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %〉
〈%Response.ContentType = "text/vnd.wap.wml; charset=UTF-8"%〉
〈?xml version="1.0"?〉
〈!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1xml"〉
〈wml〉
〈card title="邮件系统"〉
〈p〉
WML开发邮件系统
〈/p〉
〈/card〉
〈/wml〉
Save the above code as example.asp, directly through the M3gate view, the specific effect as shown in Figure I.
Figure I
"Mail system" this paragraph of text for UTF-8 code, in order to better apply to mobile browsing, the proposed code format using UTF-8, you can download WAP encoder converter to Chinese conversion.
Since our system is developed in ASP language, we need to add the following two pieces of code before the above code snippet:
〈% @LANGUAGE = "VBSCRIPT" codepage= "65001"%〉
Specifies that IIS reads the passed string (form submission, address bar delivery, and so on) in a UTF-8 encoded format, and you can change 65001 to 936 if you need to read in GB2312 format.
〈%response.contenttype = "TEXT/VND.WAP.WML; Charset=utf-8 "%〉
Specifies that the page output format is WML and is encoded as UTF-8