Unformatted text preview:

WAP and E mail by Neeraja Gudipati Contents Introduction to E mail Introduction to WAP Why WAP and E mail The Mail Process Programming E mail WML class A WAP based E mail Application E Mail E mail is an asynchronous message exchange technology E mail is a way for computer users to exchange messages as long as there are networks such as the Internet connecting them E mail the killer app of the internet is more frequently used than even the web WAP Wireless application protocol WAP is an application environment and set of communication protocols for wireless devices designed to enable manufacturer vendor and technology independent access to the Internet and advanced telephony services Why E mail and WAP E mail and WAP are fast becoming the most demanded combinations of technology by both corporations and general consumers There were 569 million e mail accounts globally at year end 1999 It is predicted that there will be in excess of one billion e mail accounts worldwide by 2002 There are currently 300 million mobile subscribers growing at 50 per annum WAP penetration into the mobile phone market is predicted to be 8 in 2000 22 in 2001 50 in 2002 and 85 in 2003 The Mail Process Important mechanisms in the mail transport system Mail User Agent MUA A program used to create and receive mail messages Mail Transfer Agent MTA The means by which mail messages are transferred between machines over the internet Mail Delivery Agent MDA The mechanism that delivers the mail message to the recipient s mailbox when mail is delivered via an MTA to the mail server Protocols used There are two types of protocol used in the e mail process Transport Protocols Example SMTP ESMTP Storage and Retrieval protocols Example POP3 IMAP4 A Typical E Mail System AP M I P 3 O P TP M S E TP M S Mail User Agent SMTP E SMTP Mail Backbone Mail Server LDAP Query Directory Services Mail Server Transmission path of e mail Submission E SMTP Sender Mail User Agent MUA Transmission E SMTP Sending Mail Transfer Agent MTA Destination Mail Transfer Agent MTA Delivery File I O INBOX Mail Delivery Agent MDA Retrieval POP IMAP Message Store Recipient Mail User Agent MUA Programming E mail The Major API sets used to construct the Messaging Applications Common Mail Calls Vendor Independent Messaging CDO and CDONTS JavaMail JavaMail JavaMail is platform independent and protocol independent and therefore presents an ideal way to build e mail and messaging solutions that will work with WAP technology Advantages It is available on the majority of current operating systems It offers an e mail API that is both flexible and easy to use It offers excellent networking capabilities as standard WML Class Encapsulates the details and logic needed by the servlet to generate a correctly formed WML page to send as the response to the user s WAP browser request WML class models the formatting and header information needed to produce a valid WML document Makes the generation of WML easier Separates some of the WML syntax logic from the Java servlet code WML Class Important Member Functions Attributes Stringbuffer buffer static final int deckSize 1024 Adds the card which has its id iD to the deck public void addCard String iD Ends the card tag public void endCard Member functions contd println appends the string line to the buffer of the WML class public void println String line outputWML gets the writer of the response and writes the contents of the buffer if the disableCaching is true the caching of WAP pages is disabled public void outputWML HttpServletResponse response boolean disableCaching WAP based E mail application WAPMail Implements a simple WAP mail system allowing access to an SMTP POP3 based e mail account Uses Java Servlets and JavaMail to Compose send and reply to mail via a SMTP server View an inbox and read mail using a POP3 service Determine the number of messages waiting in the inbox Delete mail WAPMail s Functionality Splash Screen Login Screen Main Menu Delete Compose View inbox Read Item Send Reply WAPMail java import statements import java io import java util import javax mail import javax mail internet import javax servlet import javax servlet http WAPMail extends HttpServlet import com wrox util WML WML class uses WML tags WAPMail java contd public class WAPMail extends HttpServlet implements SingleThreadModel Attributes private static String inboxString INBOX private static UserSessionData userSessionData WAPMail java contd Member Functions public void doPost HttpRequest request HttpServletResponse response GET the session data UserSessionData userSessionData getUserSessionData GET the action String action request getParameter action doPost Function SHOW SPLASH SCREEN if action null action equalsIgnoreCase login userSessionData null this splashScreen request response LOGIN else if action equalsIgnoreCase login this login request response Similarly making decision for LOGOUT SHOW MAIN MENU COMPOSE SEND VIEW INBOX READ DELETE REPLY and calling the corresponding functions end of doPost Function splashScreen Function public void splashScreen HttpServletRequest request HttpServletResponse response String message Create an object of WML WML wml new WML Add the card with id WAPMailSplash wml addCard WAPMailSplash create a label Login click activates the task wml println do type accept label Login in the case of the click action go the source of request wml println go href request getRequestURI method post post the request with action value login wml println postfield name action value login splashScreen Function contd include postfield tags for posting uid and pwd wml println go do if message null generally true when there is an error print the message wml println p Username wml println input name uid title user name br wml println Password wml println input name pwd type password title password br p wml endCard wml outputWML response true Screen shot sequence of login process login Function public void login HttpServletRequest request HttpServletResponse response Get username String username request getParameter uid Get password String password request getParameter pwd Get SMTP Session Get POP3 Session Get POP3 Store login Function contd Create a new UserSessionData object if everything is ok show main menu this mainMenu request response usd where usd is userSessionData end of login function mainMenu Function public void mainMenu HttpServletRequest request HttpServletResponse response UserSessionData userSessionData WML wml


View Full Document

WVU CS 486 - WAP and E-mail

Course: Cs 486-
Pages: 41
Loading Unlocking...
Login

Join to view WAP and E-mail and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view WAP and E-mail and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?