Sun GlassFish Enterprise Server v3 Administration Guide

ProcedureTo Create a JavaMail Resource

Use the create-javamail-resource subcommand in remote mode to create a JavaMail session resource. The JNDI name for a JavaMail session resource customarily includes the mail/ naming subcontext, For example: mail/MyMailSession.

  1. Ensure that the server is running.

    Remote subcommands require a running server.

  2. Create a JavaMail resource by using the create-javamail-resource(1) subcommand.

    Information about the properties for the subcommand is included in this help page.

  3. To apply your changes, restart Enterprise Server.

    See To Restart a Domain.

Example 18–1 Creating a JavaMail Resource

This example creates a JavaMail resource named mail/MyMailSession. The escape character (\) is used in the --fromaddress option to distinguish the dot (.) and at sign (@).

asadmin> create-javamail-resource --mailhost localhost 
--mailuser sample --fromaddress sample\@sun\.com mail/MyMailSession 
Command create-javamail-resource executed successfully.

See Also

You can also view the full syntax and options of the subcommand by typing asadmin help create-javamail-resource at the command line.