8.2.1 Session properties for connecting to the SMTP server

This subsection describes the SMTP provider and SMTPS provider-specific session properties.

The following table lists and describes the SMTP provider and SMTPS provider-specific session properties. Note that if smtps is specified as the protocol to be used, the smtp part of the property name becomes smtps.

Table 8-2 List of the SMTP provider and SMTPS provider-specific session properties

No.PropertyDefault valueValid valueOperation when an invalid value is specified
1mail.smtp.allow8bitmimefalsetrue, false
(not case-sensitive)
The message KDJE59100-W is output during the send processing to the mail server.
The default value is used.
2mail.smtp.authfalsetrue, false
(not case-sensitive)
The message KDJE59100-W is output when connecting to the mail server.
The default value is used.
3mail.smtp.connectiontimeout0
(Wait infinitely)
0 to 2147483647​
(unit: millisecond)
The message KDJE59100-W is output when connecting to the mail server.
The default value is used.
4mail.smtp.dsn.notifyNone
  • Specify either SUCCESS, FAILURE, or DELAY, or multiple values demarcated by , (comma)
  • NEVER
The specified value is used as is.
If the value is considered invalid in the mail server, the RCPT command fails, and the sending of the mail is cancelled.
The mail server processing depends on the mail server.
5mail.smtp.dsn.retNoneFULL, HDRSThe specified value is used as is.
If the value is considered invalid in the mail server, the MAIL command fails, and the sending of the mail is cancelled.
The mail server processing depends on the mail server.
6mail.smtp.ehlotruetrue, false
(not case-sensitive)
The message KDJE59100-W is output when connecting to the mail server.
The default value is used.
7mail.smtp.fromValue specified in <mail.form>Character stringJavaMail or the mail server might return an exception. The cases in which the mail server returns an exception depend on the mail server.
8mail.smtp.localhostReturn value of java.net.InetAddress.getLocalHost().getHostName()Character stringThe specified value is used as is.
9mail.smtp.noop.stricttruetrue, false
(not case-sensitive)
The message KDJE59100-W is output when the javax.mail.Transport object is obtained.
The default value is used.
10mail.smtp.quitwaitfalsetrue, false
(not case-sensitive)
The message KDJE59100-W is output when the javax.mail.Transport object is acquired.
The default value is used.
11mail.smtp.saslrealmNoneCharacter stringThe specified value is used as is.
12mail.smtp.sendpartialfalsetrue, false
(not case-sensitive)
The message KDJE59100-W is output during the send processing to the mail server.
The default value is used.
13mail.smtp.timeout0
(Wait infinitely)
0 to 2147483647​
(unit: millisecond)
The message KDJE59100-W is output when connecting to the mail server.
The default value is used.

The following is a description of the properties:

Organization of this subsection
(1) mail.smtp.allow8bitmime
(2) mail.smtp.auth
(3) mail.smtp.connectiontimeout
(4) mail.smtp.dsn.notify
(5) mail.smtp.dsn.ret
(6) mail.smtp.ehlo
(7) mail.smtp.from
(8) mail.smtp.localhost
(9) mail.smtp.noop.strict
(10) mail.smtp.quitwait
(11) mail.smtp.saslrealm
(12) mail.smtp.sendpartial
(13) mail.smtp.timeout

(1) mail.smtp.allow8bitmime

This property specifies whether to convert the quoted-printable and base64 encoded message text to an 8-bit encoding.

If you specify true and if the following conditions are fulfilled, the quoted-printable and base64 encoded message text is converted to an 8-bit encoding.

If you specify false, the text is not converted to an 8-bit encoding.

(2) mail.smtp.auth

This property specifies whether to perform user authentication using the AUTH command.

If you specify true, the user authentication is performed by using the AUTH command. If you specify false, the user authentication is not performed using the AUTH command.

(3) mail.smtp.connectiontimeout

This property specifies the timeout value until a connection is established (unit: millisecond).

If you specify 0, the system continues to wait infinitely.

When this property is specified, the timeout value is monitored by using threads. If the threads cannot be created due to the policy or system constraints, the timeout value is not monitored.

If the timeout value is greater than the timeout value based on the TCP resend timer of the OS, or if the timeout is not to be monitored, the timeout value based on the TCP resend timer is enabled. Note that the timeout based on the resend timer differs depending on the OS.

(4) mail.smtp.dsn.notify

This property specifies the NOTIFY option of the RCPT command.

This option specifies the conditions for generating the DSN (Delivery Status Notification). You can combine and specify the values described in the following table, using commas to demarcate the values.

Table 8-3 Values that can be specified in mail.smtp.dsn.notify

No.ValueSpecified contents
1NEVERThe DSN is not returned to the sender regardless of the delivery status.
2SUCCESSThe DSN is generated when the message is delivered successfully.
3FAILUREThe DSN is generated when the delivery of the message fails.
4DELAYThe DSN is generated when the delivery of the message is delayed.

If no value is specified for the DSN generation, this might be interpreted as NOTIFY=FAILURE or NOTIFY=FAILURE,DELAY has been specified in RFC1891 and depends on the implementation of the server.

(5) mail.smtp.dsn.ret

This property specifies the value of the RET addition parameter of the MAIL command.

You can combine and specify the values described in the following table.

Table 8-4 Values that can be specified in mail.smtp.dsn.ret

No.ValueSpecified contents
1FULLThe entire sent message is included in the message reporting delivery failure.
2HDRSOnly the header of the sent message is included in the message reporting delivery failure.

If you do not specify the property, the contents to be included in the message reporting delivery failure depend on the implementation of the server.

(6) mail.smtp.ehlo

This property specifies whether to use the EHLO command.

If you specify true, the EHLO command will be used. If an error occurs in the EHLO command, the HELO command is used as a substitute. If you specify false, the EHLO command is not used.

(7) mail.smtp.from

This property specifies the email address to be used in reverse-path in the SMTP and SMTPS MAIL command.

(8) mail.smtp.localhost

This property specifies the domain name of the local host used in the SMTP and SMTPS HELO command or EHLO command.

This property need not be specified if the JDK and name service is defined appropriately.

(9) mail.smtp.noop.strict

This property is used to change the response that determines the connected status when the status of connection with the mail server is checked.

If you specify true, the connected status is assumed when the mail server response for the NOOP command is 250. If you specify false, the connected status is assumed when the mail server response for the NOOP command is any positive integer value except 421.

(10) mail.smtp.quitwait

This property specifies whether the system will await a response for the QUIT command.

If you specify true, the system awaits a response for the QUIT command. If you specify false, the connection is closed immediately after the QUIT command is sent.

(11) mail.smtp.saslrealm

This property specifies the realm to be used for the DIGEST-MD5 authentication.

If you omit this property, the first realm included in the challenge from the server is used. If the challenge does not contain a realm, the connection destination host is used as the realm.

(12) mail.smtp.sendpartial

This property specifies the operation to be performed when the email address specified in a message contains an incorrect email address.

If you specify true, the message is sent and then the email address with error is reported with SendFailedException. If you specify false, the message is not sent.

(13) mail.smtp.timeout

This property specifies the timeout value (unit: millisecond) for communication (read) with the SMTP server.

If you specify 0, the system continues to wait infinitely.

If the timeout value is greater than the timeout value based on the TCP resend timer of the OS, or if the timeout is not to be monitored, the timeout value based on the TCP resend timer is enabled. Note that the timeout based on the resend timer differs depending on the OS.