All Downloads are FREE. Search and download functionalities are using the official Maven repository.

en.help.task-javamailsessioncreate.html Maven / Gradle / Ivy

The newest version!



To Create a JavaMail Session

  1. In the navigation tree, expand the Resources node.
  2. Under the Resources node, select JavaMail Sessions.

    The JavaMail Sessions page opens.

  3. In the Sessions table, click New.

    The New JavaMail Session page opens.

  4. In the JNDI Name field, type a unique name for the mail session resource.

    Use the naming sub-context prefix mail/ for JavaMail resources. For example: mail/MySession. The name must contain only alphanumeric, underscore, dash, or dot characters.

  5. In the Mail Host field, type the host 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.

  6. In the Default User field, type the user name 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. The user name must contain only alphanumeric, underscore, dash, or dot characters.

  7. In the Default Sender Address field, type the e-mail address of the default user.

    The format is username@host.domain.

  8. In the Description field, type a description of this mail session.
  9. Select the Status Enabled checkbox to enable the mail session.

    The default value is Enabled.

  10. In the Store Protocol field, define the storage protocol service to be used.

    The storage protocol service connects to a mail server, retrieves messages, and saves messages in one or more folders. Allowed values are imap, pop3, imaps, and pop3s. The default value is imap.

  11. In the Store Protocol Class field, specify the service provider implementation class for storage.

    Allowed values are:

    • com.sun.mail.imap.IMAPStore

    • com.sun.mail.pop3.POP3Store

    • com.sun.mail.imap.IMAPSSLStore

    • com.sun.mail.pop3.POP3SSLStore

    The default value is com.sun.mail.imap.IMAPStore.

  12. In the Transport Protocol field, specify the transport communication method.

    The transport protocol service sends messages. Allowed values are smtp and smtps. By default, the Transport Protocol is smtp.

  13. In the Transport Protocol Class field, specify the service provider implementation class for transport.

    The default value is com.sun.mail.smtp.SMTPTransport.

  14. 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 is generated and is included in the system log file. See To Configure Log Levels for information about setting the log level. This option is disabled by default.

  15. (Optional) In the Additional Properties table, specify additional properties required by applications, such as a protocol-specific host or username property.

    For a list of the available properties, see the JavaMail API documentation. Additional properties must begin with mail- and must use hyphens, not periods, as separators. For example, mail-debug is correct, but mail.debug is not. The GlassFish Server back end converts the hyphens into the periods expected by the JavaMail API.

    To add a property, click the Add Property button. In the blank row that appears, type the property name in the Name field, and type the property value in the Value field.

  16. From the list of available targets, select the target or targets to which to configure the mail session and click Add.

    Targets can be clusters or standalone server instances. If you do not select a target, the session is configured to the default server instance server.

  17. Click OK.

See Also

Copyright © 2005, 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices




© 2015 - 2024 Weber Informatics LLC | Privacy Policy