ASP Development example of WAP Simple Mail System (cont.)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.