Chapter 20. Managing Email in Servlets and JSPs
This chapter describes how to manage email in your servlets using the JavaMail and JavaBeans Activation Framework (JAF) APIs. JavaMail provides Java classes for dealing with most aspects of creating, sending, and accessing email. The JAF is a separate API for handling the datatypes and Multipurpose Internet Mail Extension (MIME) types you may encounter when generating email, such as the many different kinds of file attachments. Both of these APIs are a part of the Java 2 Enterprise Edition (J2EE) platform.
class), folders (the
such as the INBOX folder), email
and email addresses (the
For example, an email message is similar
to a JavaBean, with setter methods to
build the various message components
The following recipes show how to manage basic email messaging using a single servlet, as well as methods for separating the responsibility for emailing and handling HTTP requests into JavaBeans and servlets.
20.1. Placing the Email-Related Classes on your Classpath
want to use the
and related Java packages
to handle email in a
Download the ZIP files containing the mail.jar and activation.jar ...