2.17.1 create-javamail-resource
Creates a JavaMail session resource.
Synopsis
asadmin [asadmin-options] create-javamail-resource [--help] [--target target] --mailhost hostname --mailuser username --fromaddress address [--storeprotocol storeprotocol] [--storeprotocolclass storeprotocolclass] [--transprotocol transprotocol] [--transprotocolclass transprotocolclass] [--enabled={true|false}] [--description resource-description] [--property name=value[:name=value]...] jndi-name
Storage location
Application Server installation directory/javaee/glassfish/bin
Function
The create-javamail-resource subcommand of asadmin creates a JavaMail session resource. This command is supported in remote mode only.
Precondition
Domain Administration Server (DAS) is running.
Arguments
- --help | -?
-
Displays the help text for the subcommand.
- --target target
-
Specifies the target for which the JavaMail session resource is created.
Type: String
The following values can be specified:
-
server
Creates the resource for the default server instance. This is the default value.
-
domain
Creates the resource for the domain.
-
cluster_name
Creates the resource for every server instance in the cluster.
-
instance_name
Creates the resource for a specific server instance.
Default value: server
-
- --mailhost hostname
-
Specifies 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.
Type: String
The following values can be specified:
-
Specify the mail hostname
Default value: N/A
-
- --mailuser username
-
Specifies the name of the mail account user provided when connecting to a mail server.
Type: String
The following values can be specified:
-
Specify the mail user name
Default value: N/A
-
- --fromaddress address
-
Specifies the email address of the default user, in the format username@host.domain.
Type: String
The following values can be specified:
-
Specify the From address
Default value: N/A
-
- --storeprotocol storeprotocol
-
Specifies the mail server store protocol.
Type: String
The following values can be specified:
-
imap
-
pop3
Default value: imap
-
- --storeprotocolclass storeprotocolclass
-
Specifies the mail server store protocol class name.
Type: String
The following values can be specified:
-
com.sun.mail.imap.IMAPStore
-
com.sun.mail.pop.POPStore
Default value: com.sun.mail.imap.IMAPStore
-
- --transprotocol transprotocol
-
Specifies the mail server transport protocol.
Type: String
The following values can be specified:
-
smtp
-
lmtp
Default value: smtp
-
- --transprotocolclass transprotocol
-
Specifies the mail server transport protocol class name.
Type: String
The following values can be specified:
-
com.sun.mail.smtp.SMTPTransport
-
com.sun.mail.lmtp.LMTPTransport
Default value: com.sun.mail.smtp.SMTPTransport
-
- --enabled={true|false}
-
Enables the resource at runtime, if set to true.
Type: Boolean
The following values can be specified:
-
true
-
false
Default value: true
-
- --description resource-description
-
Specifies text that provides some details of the JavaMail resource.
Type: String
The following values can be specified:
-
Provide description of java mail resource
Default value: N/A
-
- --property name=value[:name=value]...
-
Specifies the optional attribute name/value pairs for configuring the JavaMail resource. Java EE Server-specific mail- prefix is converted to the standard mail prefix. The specification format is name=value. You can specify multiple values separated by a colon (:). If the same property name is specified multiple times, then the property name, which is specified at the end is valid.
For the detail about the value that you can specify the name, see the package summary of the javax.mail in the JavaDoc (http://docs.oracle.com/javaee/7/api/javax/mail/package-summary.html). The default value is nothing. For the value, you need to specify in the range of specification of the property.
name
Type: String
Default value: N/A
value
Type: String
The following values can be specified:
-
See the package summary of javax.mail package in the JavaDoc of Java Mail Specification (JavaDoc http://docs.oracle.com/javaee/7/api/javax/mail/package-summary.html).
Default value: N/A
-
- jndi-name
-
Specifies the JNDI name of the JavaMail resource to be created. It is a recommended practice to use the naming sub-context prefix mail/ for JavaMail resources.
Type: String
The following values can be specified:
-
Specify the JNDI name
Default value: N/A
-
Examples
The following example creates a JavaMail resource on the server instance instance1.
asadmin create-javamail-resource --target instance1 --mailhost localhost --mailuser sample --fromaddress sample@sun.com mail/MyMailSession
Exit Status
Exit Status |
Explanation |
---|---|
0 |
command executed successfully. |
1 |
error in executing the command. |