+

Search Tips   |   Advanced Search

Mail providers and mail sessions


A mail service provider is a driver that supports mail interaction with mail servers that use a particular mail protocol. The appserver includes service providers, which are also known as protocol providers, for mail protocols.

A mail provider encapsulates a collection of protocol providers. For example, the appserver has a built-in mail provider that encompasses the most common protocol providers. These protocol providers are installed as the default and suffice for most applications. If we have a particular application that requires custom protocol providers, follow the steps that are outlined in the chapter on mail sessions in the Java Mail API Design Specification to install our own protocol providers.

Mail sessions are represented by the javax.mail.Session class. A mail session object authenticates users and controls access to messaging systems.

To create mail applications that are platform independent, use a resource factory reference to create a mail session. A resource factory is an object that provides access to resources in the deployed environment of a program. Resource factories use the naming conventions defined by the Java ™ Naming and Directory Interface (JNDI).

Best practice: Ensure that every mail session is defined under a parent mail provider. Select a mail provider first and then create the new mail session



 

Related


Mail: Links

 

Related information


Java Mail API Design Specification, V1.4 (PDF)