English 中文(简体)
JavaMail - Environment Setup
  • 时间:2024-11-03

JavaMail API - Environment Setup


Previous Page Next Page  

To send an e-mail using your Java Apppcation is simple enough but to start with you should have JavaMail API and Java Activation Framework (JAF) installed on your machine.

You will need the JavaBeans Activation Framework (JAF) extension that provides the javax.activation package only when you re not using Java SE 6 or newer.

Download and unzip these files, in the newly created top level directories you will find a number of jar files for both the apppcations. You need to add mail.jar and activation.jar files in your CLASSPATH.

SMTP server

To send emails, you must have SMTP server that is responsible to send mails. You can use one of the following techniques to get the SMTP server:

    Install and use any SMTP server such as Postfix server (for Ubuntu), Apache James server (Java Apache Mail Enterprise Server)etc. (or)

    Use the SMTP server provided by the host provider for eg: free SMTP provide by JangoSMTP site is relay.jangosmtp.net (or)

    Use the SMTP Server provided by companies e.g. gmail, yahoo, etc.

The examples in the subsequent chapters, we ve used the free JangoSMTP server to send email. You can create an account by visiting this site and configure your email adress.
Advertisements