Chapter 30 Creating JavaMail
The J2EE specification allows you to group related Web content, EJBs, servlets, and JSPs into a Web application. A Web application is a package that can be easily deployed to any J2EE-compliant server. A Web application includes a deployment descriptor that describes how its various components should be configured on the host server.
When developing an application that includes JavaMail functionality, you must use JNDI to obtain mail sessions, as described in "Creating a JavaMail session". The use of logical names allows your application to run in environments where the JNDI namespace does not match the names hardcoded in your application. When you deploy the application, you map the logical names to actual names that match the server's configuration. You must catalog the JNDI names used by your code in the application's deployment descriptor. Once your JavaMail-enabled Web application is deployed to a host server, you must configure the javax.mail.Session resource factory reference to the name of the local mail server for that server.
To define the local mail server for a JavaMail program:
Copyright © 2000 Sybase, Inc. All rights reserved. |