18.104.22.168. JavaMail: Email-based messaging
Email is another critical communication protocol for enterprise systems. Email is a
widespread tool used for interpersonal messaging in a wide variety of contexts, from
corporate communications to family reunion planning, as anyone reading this book is
surely aware. In an enterprise application context, email can also be an important tool for
end user event notifications (for example, a notice that a lower-priced flight has matched
your travel profile), for content delivery (e.g., a weekly "ezine" delivered automatically from
a content management system), and for system monitoring (e.g., a notice to a system
administrator that connectivity to a critical information system has been lost).
J2EE's tool for composing, sending, and receiving email is the JavaMail API, contained in
the javax.mail package. For dealing with various types of content in MIME-based email
messages, a companion API called the JavaBeans Activation Framework and provided in
the javax.activation package is used in conjunction with JavaMail ("activation" in
the name refers to activating a content handler to deal with a particular type of content).
Chapter 15 is a tutorial on the use of these APIs.