Learning the JavaMail API

The JavaMail API consists of some interfaces and classes used to send, read, and delete e-mail messages. The javax.mail and javax.mail.internet packages contain all the JavaMail core classes. The javax.mail.activation package represents the JavaBean Activation Framework.

Exploring the Core Classes

The JavaMail core classes, which belong to the javax.mail package, are Session, Message, Address, Authenticator, Transport, Store, and Folder. Table 20.1 gives a brief description of each core class.

Table 20.1. Summary of JavaMail Core Classes
ClassDescription
SessionThe key class of the API. A multithreaded object represents the connection factory.
MessageAn abstract class that models an e-mail message. Subclasses provide the ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.