Overview of Using JavaMail with WebLogic Server Applications Understanding JavaMail Configuration Files

12 Programming JavaMail with WebLogic Server 12-1 12 Programming JavaMail with WebLogic Server The following sections contains information on additional WebLogic Server programming topics: ■ Section 12.1, Overview of Using JavaMail with WebLogic Server Applications ■ Section 12.2, Understanding JavaMail Configuration Files ■ Section 12.3, Configuring JavaMail for WebLogic Server ■ Section 12.4, Sending Messages with JavaMail ■ Section 12.5, Reading Messages with JavaMail

12.1 Overview of Using JavaMail with WebLogic Server Applications

WebLogic Server includes the JavaMail API version 1.4 reference implementation from Sun Microsystems. Using the JavaMail API, you can add email capabilities to your WebLogic Server applications. JavaMail provides access from Java applications to Internet Message Access Protocol IMAP- and Simple Mail Transfer Protocol SMTP-capable mail servers on your network or the Internet. It does not provide mail server functionality; you must have access to a mail server to use JavaMail. Complete documentation for using the JavaMail API is available at http:www.oracle.comtechnetworkjavajavaeeindex-jsp-139225. html . This section describes how you can use JavaMail in the WebLogic Server environment. The weblogic.jar file contains the following JavaMail API packages from Sun: ■ javax.mail ■ javax.mail.event ■ javax.mail.internet ■ javax.mail.search The weblogic.jar also contains the Java Activation Framework JAF package, which JavaMail requires. The javax.mail package includes providers for Internet Message Access protocol IMAP and Simple Mail Transfer Protocol SMTP mail servers. Sun has a separate POP3 provider for JavaMail, which is not included in weblogic.jar. You can download the POP3 provider from Sun and add it to the WebLogic Server classpath if you want to use it. 12-2 Developing Applications for Oracle WebLogic Server

12.2 Understanding JavaMail Configuration Files

JavaMail depends on configuration files that define the mail transport capabilities of the system. The weblogic.jar file contains the standard configuration files from Sun, which enable IMAP and SMTP mail servers for JavaMail and define the default message types JavaMail can process. Unless you want to extend JavaMail to support additional transports, protocols, and message types, you do not have to modify any JavaMail configuration files. If you do want to extend JavaMail, download JavaMail from Sun and follow Suns instructions for adding your extensions. Then add your extended JavaMail package in the WebLogic Server classpath in front of weblogic.jar.

12.3 Configuring JavaMail for WebLogic Server