JavaMail API - SPLessons

JavaMail Overview

Chapter 2

SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

JavaMail Overview

JavaMail Overview

shape Introduction

JavaMail Overview, JavaMail API is the concept related to email through the JavaMail. By using JavaMail API sending, receiving, deleting, managing the email. JavaMail API is platform, protocol independent framework for to send or receive mail. JavaMail API also provides core classes for to define objects and used that objects to maintain a mail system. Here are some protocols which support the JavaMail API, they are

SMTP: It is an acronym for the “Simple Mail Transfer Protocol”, which issues a instrument to deliver the electronic mail(Email). An authentication is required in case of sending and receiving the emails through SMTP server which was provided by host server. An SMTP server also uses the Postcast server, ApacheJames server.

POP: It is an acronym for the “Post Office Protocol”, Which supports to receive the email. For each user POP supports the single mail box. POP is defined by RFC 1939.

MIME: It is an acronym for the “Multiple Internet Mail Extension”. It just explains the content transferred like attachments and which type of formatted message.

IMAP: It is an acronym for the “Internet Message Access Protocol”. It is an advanced one to receive the messages. For each user IMAP supports the multiple mail box and by multiple users the mail box shared. IMAP is defined in RFC 2060.

NNTP: It is an acronym for the “Network News Transfer Protocol”, it is the third party provider protocol.

shape Conceptual

Architecture for JavaMail API is shown below:

From the above figure, the JavaMail API uses the java application to send, receive, compose the email. It also uses the Server Provider Interface (SPI) to provide the intermediate services to java application, because of this JavaMail API can deal with many protocols.

Environment Setup

shape Description

The JavaMail API and JAF(JAVA ACTIVATION FRAMEWORK) are installed in system for sending, receiving email through JavaMail.

Step1: Download the JavaMail 1.5.0 from standard website then,

Step2: Download the (Java Activation Framework) JAF 1.1.1 from standard website.

Step3: Add jar files of both mail.jar and activation.jar in class path.

To get SMTP server: The SMTP server is responsible for sending the emails, SMTP server provided by different servers like

  • Host provider provides SMTP server
  • ApacheJames server provides SMTP server
  • Yahoo, Gmail companies provides the SMTP server
  • Free SMTP server provided by jangoSMTP

These are the providers to use any one SMTP sever in our application.


shape Key Points

  • JavaMail Overview – JavaMail API is the concept related to email through the JavaMail.
  • JavaMail Overview – By using JavaMail API sending, receiving, deleting, managing and composing the email.
  • JavaMail Overview – Types of protocols to support JavaMail API.
  • JavaMail Overview – Environmental set up for JavaMail API.
  • JavaMail Overview – Install and use the Free SMTP server provided by jangoSMTP.