Saturday, January 10, 2009

Installing JavaMail API

Installing JavaMail API

To use the JavaMail API, download the JavaMail implementation, unbundle the javamail-[version].zip file, and add the mail.jar file to your CLASSPATH. The implementation comes with an SMTP, IMAP4, and POP3 provider besides the core classes.

Note: After installing Sun's JavaMail implementation, you can find many example programs in the demo directory.

After installing JavaMail, install the JavaBeans Activation Framework.

Installing the JavaBeans Activation Framework

All versions of the JavaMail API require the JavaBeans Activation Framework. The framework adds support for typing arbitrary blocks of data and handling it accordingly. This doesn't sound like much, but it is your basic MIME-type support found in many browsers and mail tools, today. After downloading the framework, unbundle the jaf-[version].zip file, and add the activation.jar file to your CLASSPATH.

You should now have added mail.jar and activation.jar to your CLASSPATH.

If you don't want to change the CLASSPATH environment variable, copy the JAR files to your lib/ext directory under the Java Runtime Environment (JRE) directory. For instance, for the J2SE 1.3 release, the default directory would be C:\jdk1.3\jre\lib\ext on a Windows platform.

Using with the Java 2 Enterprise Edition

If you use J2EE, there is nothing special you have to do to use the basic JavaMail API; it comes with the J2EE classes. Just make sure the j2ee.jar file is in your CLASSPATH and you're all set.





******************************************************


No comments:

Post a Comment