Show TOC

Component documentationUsing JavaMail Locate this document in the navigation structure

 

Overview

The JavaMail Client Service provides a client functionality that allows users to add e-mail and news capabilities to applications deployed on AS Java. It implements the client side of the following mail protocols:

  • Simple Mail Transfer Protocol (SMTP) - The basic protocol used for sending e-mail messages.

  • Post Office Protocol 3 (POP3) - The protocol for retrieving e-mail messages from a remote server.

  • IMAP4 - Allows a local client to retrieve e-mail message from a remote server.

  • Network News Transfer Protocol (NNTP) - The protocol for newsgroup communication.

It can also establish secure connections over these protocols, using SSL encryption and certificate-based authentication.

The JavaMail Client Service implementation is written in accordance with Sun JavaMailTM API Design Specification 1.4. It uses Sun Microsystems' provider implementation for the SMTP, POP3 and IMAP4 protocols and its own provider implementation for the NNTP protocol.

The Java Mail Client Service uses mail-activation-iaik library that consists of activation, Java Mail API and implementation, and IAIK SSL implementation components.

Overview of the Development Process

The mail client functionality is represented by Sun's Java Mail API.

Usually, you use the Mail Client functionality in session beans. You can also use it in JSP and servlet components. You need to implement the following steps:

  1. (Optional) Configure the JavaMail Client Service.

    More information: Configuring the JavaMail Client Service

  2. Obtain a session object, which represents the client session with the mail server.

    More information: Obtaining a Session Object

  3. Perform the necessary sending or receiving operations, using the session object. Namely, you can:

  4. After finishing with the e-mail operations, destroy the obtained Transport and Store object.