Hi Victor,
Very good suggestions! Welcome to bytes.com. Have you used Jmail and VML before? Can you tell us a little about those technologies and what they are designed to do?
-Red
WML = Wireless Markup Language.It's use in development of WAP .All of wap browser support it . This is "Hello World",It is a subset of XML. You can see more information in
http://en.wikipedia.org/wiki/Wireless_Markup_Language
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="HELLO" title="HELLO">
Hello world!
</card>
</wml>
---------------------------------------------------------------------------------------------------------
Jmail:it's a server-side components for sending mail. if you use it in mobile wap develop you can see sample Demo.It's just easy but it contains all of process for WML+JMAIL using. Hope this one may help you to deal with your problems.````My english is not good ,so my replys may have some grammar mistakes. Smiling ``````
----------------------------------------------------------------------------------------------------------
1. down Jmail from http://tech.dimac.net/
-------------------------------------------------------------------------------------------------------------
2.send.asp
〈% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %〉
〈%Response.ContentType = "text/vnd.wap.wml; charset=UTF-8"%〉
〈?xml version="1.0" encoding="utf-8"?〉
〈!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"〉
〈wml〉
〈card id="main" title="send mail"〉
〈p〉
〈%
user=request("user")
pwd=request("pwd")
%〉
Recipients:
〈input type="text" title="Recipients" name="tomail" size="12" maxlength="50"/〉〈br/〉
Title:
〈input type="text" title="Title" name="subject" size="12" maxlength="50"/〉
〈br/〉content:
〈input type="text" title="content" name="body" size="12" maxlength="250"/〉〈br/〉
〈do type="accept" label="send" optional="false"〉
〈go href="sendok.asp?user=〈%=user%〉&pwd=〈%=pwd%〉" method="post" accept-charset="utf-8"〉
〈postfield name="from" value="$(from)"/〉
〈postfield name="tomail" value="$(tomail)"/〉
〈postfield name="subject" value="$(subject)"/〉
〈postfield name="body" value="$(body)"/〉〈/go〉
〈/do〉
〈/p〉
〈p〉
〈a href="main.asp?user=〈%=user%〉&pwd=〈%=pwd%〉"〉Back /a〉〈/p〉
〈/card〉
〈/wml〉
----------------------------------------------------------------------------------------------------------
3.sendOK.asp
〈% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %〉
〈%Response.ContentType = "text/vnd.wap.wml; charset=UTF-8"%〉
〈?xml version="1.0" encoding="utf-8"?〉
〈!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"〉
〈wml〉
〈card id="main" title="send Email"〉
〈p〉
〈%
user=request("user")
pwd=request("pwd")
tomail=request("tomail")
'from=request.form("from")
subject=request.form("subject")
body=request.form("body")
servermail=user+"@hotmail.com"
dim JMail
set JMail=server.CreateObject("Jmail.message")
JMail.Silent=true
JMail.Charset = "utf-8"
JMail.from =""&ServerMail&""
JMail.AddRecipient tomail
JMail.Subject =""&subject&""
jmail.Body=""&body&"-body HOHO my emil:victorhurui@hotmail.com--"
JMail.MailServerUserName =user
JMail.MailServerPassWord = pwd
JMail.MailDomain = "www.hotmail.com"
JMail.Priority=2
sendok=JMail.send("smtp.hotmail.com")
Set JMail=nothing
if sendok then
response.write "send OK!〈a href='main.asp?user="&user&"&pwd="&pwd&"'〉BACK〈/a〉"
else
response.write "send fail!〈a href='send.asp?user="&user&"&pwd="&pwd&"'〉BACK〈/a〉"
end if
%〉
〈/p〉
〈/card〉
〈/wml〉
----------------------------------------------------------------------------------------------------------------
4 .email_list.asp
〈% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %〉
〈%Response.ContentType = "text/vnd.wap.wml; charset=UTF-8"%〉
〈?xml version="1.0" encoding="utf-8"?〉
〈!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"〉
〈wml〉
〈card id="main" title="receive"〉
〈p〉
〈%
user=request("user")
pwd=request("pwd")
dim perpage_num,curpage,totalpage
perpage_num=3 'set how many emails per page show
if request("page")="" then
curpage=1 'now page
else
curpage=int(request("page"))
end if
Set pop3 = Server.CreateObject( "JMail.POP3" )
pop3.connect user,pwd,"http://pop3.hotmail.com"
' POP3 user,password,POP3 address
if pop3.count mod perpage_num〈〉0 then
totalpage=int(pop3.count / perpage_num)+1
else
totalpage=int(pop3.count / perpage_num)
end if
Response.Write( "you have" & pop3.count & " emails。totalpage "&totalpage&" page,current "&curpage&" page〈br/〉---------------------〈br/〉" )
if pop3.count 〉 0 then 'if no email then response NO EMAIL
if pop3.count〉=perpage_num*curpage then
for i=(curpage-1)*perpage_num to curpage*perpage_num-1%〉
〈a href="email_info.asp?id=〈%=i+1%〉&user=〈%=user%〉&pw d=〈%=pwd%〉&page=〈%=curpage%〉"〉〈%=pop3.messages.ite m(i+1).Subject%〉--〈%=pop3.messages.item(i+1).date%〉〈/a〉〈br/〉
〈%next
%〉
〈%if curpage〉1 then%〉
〈a href="email_list.asp?page=〈%=curpage-1%〉&user=〈%=user%〉&pwd=〈%=pwd%〉"〉PRE〈/a〉
〈%end if%〉
〈%if int(curpage)〈int(totalpage) then%〉
〈a href="email_list.asp?page=〈%=curpage+1%〉&user=〈%=u ser%〉&pwd=〈%=pwd%〉"〉NEXT〈/a〉
〈%end if%〉
〈%
else
for i=(curpage-1)*perpage_num to pop3.count-1%〉
〈a href="email_info.asp?id=〈%=i+1%〉&user=〈%=user%〉&pw d=〈%=pwd%〉&page=〈%=curpage%〉"〉〈%=pop3.messages.ite m(i+1).Subject%〉--〈%=pop3.messages.item(i+1).date%〉〈/a〉〈br/〉
〈%next%〉
〈%if curpage〉1 then%〉
〈a href="email_list.asp?page=〈%=curpage-1%〉&user=〈%=user%〉&pwd=〈%=pwd%〉"〉PRE〈/a〉
〈%end if%〉
〈%if int(curpage)〈int(totalpage) then%〉
〈a href="email_list.asp?page=〈%=curpage+1%〉&user=〈%=u ser%〉&pwd=〈%=pwd%〉"〉NEXT〈/a〉
〈%end if%〉
〈%
end if
else
response.write("NO EMAIL!")
end if
pop3.Disconnect
%〉
〈/p〉
〈p〉
〈a href="main.asp?user=〈%=user%〉&pwd=〈%=pwd%〉"〉BACK〈/a〉
〈/p〉
〈/card〉
〈/wml〉
----------------------------------------------------------------------------------------------------------------
5.email_info.asp
〈% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %〉
〈%Response.ContentType = "text/vnd.wap.wml; charset=UTF-8"%〉
〈?xml version="1.0" encoding="utf-8"?〉
〈!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"〉
〈wml〉
〈card id="main" title="view email"〉
〈p〉
〈%
user=request("user")
pwd=request("pwd")
id=request("id")
page=request("page")
Set pop3 = Server.CreateObject( "JMail.POP3" )
' POP3 user,password,POP3 address
pop3.connect user,pwd,"http://pop3.hotmail.com"
Set msg = pop3.Messages.item(id)
ReTo = ""
ReCC = ""
Set Recipients = msg.Recipients
separator = ", "
For i = 0 To Recipients.Count - 1
If i = Recipients.Count - 1 Then
separator = ""
End If
Set re = Recipients.item(i)
If re.ReType = 0 Then
ReTo = ReTo & re.Name & re.EMail & separator
else
ReCC = ReTo & re.Name & re.EMail & separator
End If
Next
body=msg.body
body=replace(body,"〈","")
body=replace(body,"〉","")
Set Attachments = msg.Attachments
%〉
〈a href="email_title.asp?user=〈%=user%〉&pwd=〈%=pwd%〉& page=〈%=page%〉"〉BACK〈/a〉 〈a href="reply.asp?user=〈%=user%〉&pwd=〈%=pwd%〉&mailto =〈%=msg.From%〉"〉reply〈/a〉 〈a href="email_del.asp?user=〈%=user%〉&pwd=〈%=pwd%〉&id =〈%=id%〉"〉delete〈/a〉
〈/p〉
〈p〉
from:〈%= msg.FromName %〉--〈%=msg.date%〉〈br/〉
title:〈%= msg.Subject %〉〈br/〉
content:〈%= body %〉〈br/〉
〈%
if Attachments.Count〉0 then
response.Write("It contain attachments!")
end if
pop3.Disconnect
%〉
〈/p〉
〈p〉
〈a href="email_list.asp?user=〈%=user%〉&pwd=〈%=pwd%〉&p age=〈%=page%〉"〉back〈/a〉 〈a href="reply.asp?user=〈%=user%〉&pwd=〈%=pwd%〉&mailto =〈%=msg.From%〉"〉reply〈/a〉 〈a href="email_del.asp?user=〈%=user%〉&pwd=〈%=pwd%〉&id =〈%=id%〉"〉delete〈/a〉
〈/p〉
〈/card〉
〈/wml〉
----------------------------------------------------------------------------------------------------------------
6. email_del.asp
〈% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %〉
〈%Response.ContentType = "text/vnd.wap.wml; charset=UTF-8"%〉
〈?xml version="1.0" encoding="utf-8"?〉
〈!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"〉
〈wml〉
〈card id="main" title="delete OK"〉
〈p〉
〈%
user=request("user")
pwd=request("pwd")
id=request("id")
Set pop3 = Server.CreateObject( "JMail.POP3" )
pop3.connect user,pwd,"http://pop3.hotmail.com"
pop3.deletesinglemessage id
pop3.Disconnect
Set JMail=nothing
response.write delok&"delete OK!〈a href='email_list.asp?user="&user&"&pwd="&pwd&"'〉BA CK〈/a〉"
%〉
〈/p〉
〈/card〉
〈/wml〉
----------------------------------------------------------------------------------------------------------------
7.Reply.asp
〈% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %〉
〈%Response.ContentType = "text/vnd.wap.wml; charset=UTF-8"%〉
〈?xml version="1.0" encoding="utf-8"?〉
〈!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"〉
〈wml〉
〈card id="main" title="Send"〉
〈p〉
〈%
user=request("user")
pwd=request("pwd")
tomail=request("mailto")
%〉
From:
〈%=tomail%〉〈br/〉
Title:
〈input type="text" title="Title" name="subject" size="8" maxlength="50"/〉
〈br/〉Content:
〈input type="text" title="Content" name="body" size="8" maxlength="250"/〉〈br/〉
〈do type="accept" label="Send" optional="false"〉
〈go href="sendok.asp?user=〈%=user%〉&pwd=〈%=pwd%〉&t omail=〈%=tomail%〉" method="post" accept-charset="utf-8"〉
〈postfield name="subject" value="$(subject)"/〉
〈postfield name="body" value="$(body)"/〉〈/go〉
〈/do〉
〈/p〉
〈p〉
〈a href="email_list.asp?user=〈%=user%〉&pwd=〈%=pwd%〉"〉 Back〈/a〉〈br/〉
〈a href="main.asp?user=〈%=user%〉&pwd=〈%=pwd%〉"〉Back〈/a〉〈/p〉
〈/card〉
〈/wml〉
----------------------------------Victo Hu, a mobile developer from China