Sun Java™ System Application Server Platform Edition 8 Administration Guide |
Chapter 5
JavaMail ResourcesThis chapter briefly describes how to configure resources for applications that use the JavaMail API. It contains the following sections:
About JavaMailThe JavaMail API
The JavaMail API is a set of abstract APIs that model a mail system. The API provides a platform-independent and protocol-independent framework to build mail and messaging applications. The JavaMail API provides facilities for reading and sending email. Service providers implement particular protocols.
The JavaMail API is implemented as a Java platform optional package and is also available as part of the J2EE platform.
The Sun Java System Application Server Platform Edition 8 includes the JavaMail API along with a JavaMail service provider that allows an application component to send email notifications over the Internet and to read email from IMAP and POP3 mail servers.
For more information about the JavaMail API, go to the JavaMail website (
http://java.sun.com/products/javamail/
).
Admin Console Tasks for JavaMailCreating a JavaMail Session
- In the tree component, select the Java Mail Sessions node.
- On the Java Mail Sessions page, click New. The Create Java Mail Session page appears.
- In the JNDI Name field, type the name of the session. For example:
mail/MySession
It is a recommended practice to use the naming subcontext prefix
mail/
for JavaMail resources.- In the Mail Host field, type the DNS name of the default mail server. The connect methods of the Store and Transport objects use this value if a protocol-specific host property is not supplied. The name must be resolvable to an actual host name.
- In the Default User field, type the username to provide when connecting to a mail server. The connect methods of the Store and Transport objects use this value if a protocol-specific username property is not supplied.
- In the Default Return Address field, type the email address of the default user, in the form username
@
host.
domain.- Deselect the Enabled checkbox if you do not want to enable the mail session at this time.
- In the Advanced area, change the field values only if you have reconfigured the Application Server’s mail provider to use a nondefault store or transport protocol. By default, the Store Protocol is
imap
; the Store Protocol Class iscom.sun.mail.imap.IMAPStore
; the Transport Protocol issmtp
; and the Transport Protocol Class iscom.sun.mail.smtp.SMTPTransport
.Select the Debug checkbox to enable extra debugging output, including a protocol trace, for this mail session. If the JavaMail log level is set to
FINE
or finer, the debugging output will be generated and will be included in the system log file. See Configuring Log Levels for information about setting the log level.- In the Additional Properties area, click Add Property to add properties required by your application, such as a protocol-specific host or username property. The JavaMail API documentation lists the properties you might want to set (
http://java.sun.com/products/javamail/javadocs/index.html
).- Click OK to save the session.
Equivalent
asadmin
command:create-javamail-resource
Editing a JavaMail Session
Deleting a JavaMail Session
Equivalent
asadmin
command:delete-javamail-resource