WAP and Email - PowerPoint PPT Presentation

Loading...

PPT – WAP and Email PowerPoint presentation | free to download - id: 4955e-MjQzY



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

WAP and Email

Description:

post the request with action value = login ... include postfield tags for posting uid and pwd. wml.println(' /go /do '); if(message ! ... – PowerPoint PPT presentation

Number of Views:104
Avg rating:3.0/5.0
Slides: 42
Provided by: csee1
Learn more at: http://www.csee.wvu.edu
Category:
Tags: wap | email | login | tagged

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: WAP and Email


1
WAP and E-mail
  • by
  • Neeraja Gudipati

2
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
3
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.

4
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.
5
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.

6
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 recipients
mailbox when mail is delivered via an MTA to the
mail server
7
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

8
A Typical E-Mail System
SMTP/E-SMTP
POP3/IMAP
Mail Backbone
SMTP/E-SMTP
Mail Server
Mail Server
Mail Server
LDAP Query
Mail User Agent
Directory Services
9
Transmission path of e-mail
Submission E-SMTP
Delivery File I/O
Retrieval POP/IMAP
Transmission E-SMTP
Recipient Mail User Agent (MUA)
Sending Mail Transfer Agent (MTA)
Sender Mail User Agent (MUA)
Destination Mail Transfer Agent (MTA)
INBOX Mail Delivery Agent (MDA)
Message Store
10
Programming E-mail
  • The Major API sets used to construct the
    Messaging Applications
  • Common Mail Calls
  • Vendor Independent Messaging
  • CDO and CDONTS
  • JavaMail

11
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

12
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 users 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.

13
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()
14
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(HttpServletRe
sponse response, boolean disableCaching)
15
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

16
WAPMails Functionality
Login Screen
Splash Screen
Main Menu
Compose
View inbox
Delete
Send
Read Item
Reply
17
WAPMail.java
/ import statements / import java.io. import
java.util. import javax.mail. import
javax.mail.internet. import javax.servlet. imp
ort javax.servlet.http. //WAPMail extends
HttpServlet import com.wrox.util.WML // WML
class uses WML tags
18
WAPMail.java(contd.)
public class WAPMail extends HttpServlet
implements SingleThreadModel / Attributes
/ private static String inboxString
INBOX private static UserSessionData
_userSessionData
19
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)
20
doPost Function
/ SHOW SPLASH SCREEN / if((action null)
((!action.equalsIgnoreCase(login))
(userSessionData null))) this.splashScreen(r
equest,response,) / LOGIN / else if
(action.equalsIgnoreCase(login)) this.login(req
uest, 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 /
21
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(ltdo type accept label
Logingt) / in the case of the click action
go the source of request / wml.println(ltgo
href request.getRequestURI() method
postgt) / post the request with action value
login / wml.println(ltpostfield name "action"
value "login"/gt)
22
splashScreen Function(contd.)
// include postfield tags for posting uid and
pwd wml.println(lt/gogt lt/dogt) if(message !
null) / generally true when there is an error
/ //print the message wml.println(ltpgt
Username ) wml.println(ltinput nameuid
titleuser name/gt ltbr/gt) wml.println(Password
) wml.println("ltinput name"pwd"
type"password" title"password"/gtltbr/gt
lt/pgt) wml.endCard() wml.outputWML(response,
true) / end of splashScreen /
23
Screen shot sequence of login process
24
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
25
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 /
26
mainMenu Function
public void mainMenu(HttpServletRequest request,
HttpServletResponse response, UserSessionData
userSessionData) WML wml new WML() /Add the
card with id WAPMailMainMenu with the
title Main Menu / wml.addCard("WAPMailMainMenu",
"Main Menu") wml.println("ltanchorgt1. Read Mail
) / print the total number of messages in the
inbox / wml.println(this.getInboxCount(userSessio
nData)) wml.println(ltgo href
request.getRequestURI())
27
mainMenu Function(contd.)
wml.println(?actionviewinbox"/gt) wml.println(
lt/anchorgtltbr/gt) // Similar code for // 2.
Compose, action compose // 3. Logout , action
logout wml.endCard() wml.outputWML(response,
true)
OUTPUT
28
viewInbox Function
public void viewInbox(HttpServletRequest
request, HttpServletResponse response,
UserSessionData userSessionData) / Get the
inbox Folder / Folder folder
userSessionData.getPop3Store().getFolder(inboxStri
ng) / Open the Folder in the READ_ONLY mode
/ folder.open(Folder.READ_ONLY) / Get
Directory / Message message
folder.getMessages()
29
viewInbox Function(contd.)
/ Get the number of messages in the folder
/ int n message.length WML wml new
WML() wml.addCard("WAPMailViewInbox") / print
inbox with the left alignment / wml.println("ltp
align"left"gt") wml.println("Inboxltbr/gt")
30
viewInbox Function(contd.)
// for each message print the From address ,
print the subject // provide an anchor tag and
go tag for read and delete to //link read and
delete to their corresponding functions wml.endCar
d() wml.outputWML(response, true) / Close
connection / folder.close(false)
31
read Function
public void read(HttpServletRequest
request, HttpServletResponse response,
UserSessionData userSessionData) // Get Folder
i.e folder // Get Message i.e. message / Get
Content / Object messageContent
message.getContent() WML wml new
WML() wml.addCard(WAPMailReadMail)
32
read Function(contd.)
/ print From ,the from address , the subject
/ String emailAddress ((InternetAddress)messag
e.getFrom()0).getAddress() wml.println("ltp
align"left"gt" "From " emailAddress
"ltbr/gt" message.getSubject() "ltbr/gt" )
33
read Function(contd.)
/ print the content of the mail if it is of type
plain text else print error / if(message.isMimeTy
pe(text/plain) messageContent instanceof
String) wml.println((String)messageContent) els
e wml.println(Error! WAP Mail can only read
plaintext e-mails)

34
read Function(contd.)
// provide an anchor tag and go tag for //
reply,delete, mainmenu and viewinbox wml.endC
ard() wml.outputWML(response, true) folder.close
(false) // end of read function
OUTPUT
35
logout Function
public void logout(HttpServletRequest request,
HttpServletResponse response) / destroy the
session data / this.getUserSessionData().destroy(
) / make the session data null / this.
_userSessionData null / create a new WML
object / WML wml new WML() / Add the card
with id WAPMailSplash / wml.addCard("WAPMailLog
out")
36
logout Function(contd.)
wml.println("ltp align"left"gt" "Thank you for
using WAP Mailltbr/gt" "ltanchorgtRestart E-mail"
"ltgo href"" request.getRequestURI() ""/gt"
"lt/anchorgt" "lt/pgt") wml.endCard() wml.output
WML(response, true) / end of logout function
/ / end of WAPMail class /
37
Other Functions
  • public void compose(HttpServletRequest request,
    HttpServletResponse response, String to, String
    subject)
  • public void replyToMessage(HttpServletRequest
    request, HttpServletResponse response,UserSessionD
    ata userSessionData)
  • public void deleteMessage(HttpServletRequest
    request, HttpServletResponse response,UserSessionD
    ata userSessionData)
  • public void send(HttpServletRequest request,
    HttpServletResponse response, UserSessionData
    userSessionData)

38
Enhancements to WAPMail
  • Use HttpSession tracking to allow multi-user
    access to WAPMail.
  • Allow the user to specify the POP3 and SMTP
    servers, perhaps allow for multiple accounts to
    be read.
  • If the e-mail contains illegal WML characters,
    then the e-mail text needs to be parsed to
    ensure that we encounter no problems.

39
Future
The ultimate goal for messaging technology is a
universal inbox in which voice, fax and e-mail
can be viewed in any format by a mobile
communicator device.
40
References
  • http//www.allnetdevices.com/developer/tutorials
    /2000/08/ 08/wap_and.html
  • http//www.allnetdevices.com/developer/tutorials
    /2000/08/ 15/wap_and.html
  • http//www.allnetdevices.com/developer/tutorials
    /2000/08/ 21/wap_and.html
  • http//www.allnetdevices.com/developer/tutorials
    /2000/09/ 05/wap_and.html
  • www.w3schools.com/wap

41
QUESTIONS ?? E-mail gudipati_at_csee.wvu.edu
About PowerShow.com