★ wanayoo — archive 1999 http://www.networkcomputing.com/netdesign/wap2.htmlNouvelle recherche | Portail wanayoo

       
NWC     Internet   Site Map

Getting StartedTechnology GuideDepartmentsresearch CenterSales & Marketing
FAQs Site Map Staff Article Index Current Issue




Professional WAP

July 10, 2000

Brought to you by:



This manuscript is an abridged version of a chapter from the Wrox Press book Professional WAP.

This chapter looks at WAP and E-mail. From discussing the key elements of E-mail, topics include an introduction to the Java Mail API, simplifying WML generation, E-commerce sites and WAP based E-mail applications.


Table of contents:

Introduction to the JavaMail API

The JavaMail API offers a clean object-oriented framework of classes that model a theoretical mail system. 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.

Many applications can benefit from e-mail support; using JavaMail, developers can rapidly construct messaging functionality whilst abstracting the underlying vendor's implementation in a similar way to the abstraction achieved from relational databases with JDBC.

In many ways the JavaMail service providers act in a similar way to those that provide JDBC drivers, doing for SMTP, Lotus Notes etc, what JDBC does for Oracle and Sybase. In our examples we use the SMTP and POP3 drivers provided by Sun.

JavaMail models an abstract messaging service and any vendor-specific mail system that provides a JavaMail interface implementation can be accessed with minimal —(ideally no) — recoding.

Next we are going to take a look at some examples that make use of e-mail capabilities using JavaMail. The first example will show how an m-commerce application can use SMTP to send an e-mail confirming to the customers that their order has been placed, and the second example will utilize SMTP and POP3 to code a WAP based web mail application.

The following sections assume a basic working knowledge of Java Servlets. These were introduced in Chapter 10, but for more detailed information, see Java Server Programming by Andrew Patzer et al, published by Wrox.ISBN 1861002777.

Installation of tools

All the examples in this chapter were tested under Microsoft Windows NT version 4.0, service pack 5, and Windows 98 and Windows 2000. You will need to download and install the following software to compile and run the examples in the rest of this chapter:

  • JDK (Java Development Kit) 1.2.2. Download from http://java.sun.com/jdk/
  • JSDK (Java Servlet Development Kit) 2.1. Download from http://java.sun.com/products/ (This is also available in the JSWDK download)
  • JAF (Java Activation Framework). Download from http://java.sun.com/beans/glasgow/jaf.html
  • Java Mail 1.1.3, which includes an SMTP service provider. Download from http://java.sun.com/products/javamail
  • Java Mail POP3 provider. Separate download from http://java.sun.com/products/javamail/pop3.html

You will also need to have access to a web server, in which to deploy the Java servlets we will write, and a WAP browser emulator, to test the code. In this chapter we used:

  • Gefion Web Server Lite (http://www.gefionsoftware.com/LiteWebServer/)
  • Phone.com UP.SDK 4.0 beta 2 Simulator (http://www.phone.com)

Access to a SMTP server and a POP3 server is also needed. You can find out your POP3 and SMTP host names by contacting your Internet Service Provider or network administrator. They will be similar to the following:

  • pop.yourISP.net
  • smtp.yourISP.net

Classpath

You will need to add the following jar files to your Java environment's CLASSPATH variable in order to compile the example.

Under Windows 95/98 the relevant CLASSPATH amendments can be made in your autoexec.bat:

 
                CLASSPATH = C:\jaf-1.0.1\activation.jar;

                CLASSPATH = %CLASSPATH%;c:\jsdk2.1\servlet.jar;

                CLASSPATH = %CLASSPATH%;c:\pop3-1.1.1\pop3.jar;

                CLASSPATH = %CLASSPATH%;c:\javamail-1.1.3\mail.jar;

                CLASSPATH = %CLASSPATH%;c:\jdk1.2.2\lib\WML.jar;
                

Under Windows NT, you can make the necessary changes by right-mouse clicking on the My Computer icon on your desktop and choosing Properties, or opening the System icon in the Control Panel. The Classpath environment variable can then be added or modified in the Environment tab.

PAGE: 1 I 2 I 3 I 4 I NEXT PAGE
 
Advertisement

Printer Print Full Article
Printer Print This Page
E-Mail E-mail this URL
Tool
arrow  Events
arrow  IT Training
arrow  Company Directory
arrow  Reader Service

Get NWC
Subscribe to Network Computing magazine and our Free, weekly E-Mail newsletter.


Spotlight
E-Commerce Survey!
Are you conducting E-business? If so, we want to hear from you. Please take a few minutes and fill out our online questionnaire on payment services. You could win a $200.00 American Express gift certificate!


UnixWorld | Network Design Manual | Interactive Buyer's Guide | WANsites | Real-World Labs | Learn IT | Careers | Article Index |

Home | Technology Guides | Site Map | FAQ | Subscriptions | Contacts | Sales & Marketing | 2000 Edit Calendar |

Network Computing

Byte.com |  Bank Systems & Technology |  CMPmetrics |  eBusiness Expo |  File Mine |  InformationWeek |  Insurance & Technology | 
InternetWeek |  PC Expo |  Planet IT |  TechCalendar |  TechEncyclopedia |  TechLearning | 
TechShopper |  TechWeb News |  TechWeb Today |  Wall Street & Technology |  WebTools |  Winmag.com | 


TechWeb is brought to you by CMP Media, Inc., Copyright © 2000 - Privacy Statement