3) Send mail
Figure Five
The implementation of the function of sending mail mainly uses the Jmail.message object to complete, about the object to use the relevant knowledge has been described in the previous, you can be the above functional introduction and source control to read, so as to help understand the entire mail delivery process, of course, if the WM elements for HTMLF elements, such a simple we b mail to send the function is completed, send.asp for the mail to send the page sendok.asp send processing page for the message
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= "Outbox"
〈p〉
〈%
User=request ("User")
Pwd=request ("pwd")
%〉
Recipient:
〈input type= "text" title= "Recipient" Name= Tomail "size=" "maxlength=" 50 "/〉〈br/〉
Title:
〈input type= "text" title= "title" Name= "Subject" size= "a" maxlength= "50"/〉
〈br/〉 content:
〈input type= "text" title= "content" name= "body" size= "" 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%〉" return to the mailbox 〈/a〉〈/p〉
〈/card〉
〈/wml〉
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 Mail"
〈p〉
〈%
User=request ("User")
Pwd=request ("pwd")
Tomail=request ("Tomail")
' From=request.form ("from")
Subject=request.form ("Subject")
Body=request.form ("Body")
servermail=user+ "@sohu. com"
Dim JMail
Set Jmail=server. CreateObject ("Jmail.message")
Jmail.silent=true
Jmail.charset = "gb2312"
Jmail.from = "" &ServerMail& "" is the sender.
Jmail.addrecipient Tomail
Jmail.subject = "" &subject& ""
JMail. Body= "&body&"----------your current users to win the palm of the mail system, please visit: http://www.palmmail.cn Mail through the world! ----------"
Jmail.mailserverusername =user
Jmail.mailserverpassword = pwd
Jmail.maildomain = "Www.sohu.com"
jmail.priority=2
Sendok=jmail.send ("smtp.sohu.com")
Set jmail=nothing
If Sendok Then
Response.Write "Send success!〈a href= ' main.asp?user=" &user& "&pwd=" &pwd& "" "Back to Mailbox 〈/a〉"
Else
Response.Write "Send failed!〈a href= ' send.asp?user=" &user& "&pwd=" &pwd& "" "Back to Mailbox 〈/a〉"
End If
%〉
〈/p〉
〈/card〉
〈/wml〉
4) Receive mail
Figure Six