Package gnu.mail.providers.smtp

A provider for the Simple Mail Transfer Protocol (SMTP), as detailed in RFC 2821, including support for ESMTP service extensions.

See: Description

Package gnu.mail.providers.smtp Description

A provider for the Simple Mail Transfer Protocol (SMTP), as detailed in RFC 2821, including support for ESMTP service extensions.

This provider can use SMTP authentication via any installed SASL mechanism, and transport layer security (TLS) for servers that support it (RFC 2554 and 3207).

You may also optionally request Delivery Status Notifications (DSN) as specified in RFC 3461, and/or message tracking (MTRK) as specified in RFC 3885.

The provider supports the following session properties:

Name Type Description
mail.smtp.host IP address or hostname The SMTP server to connect to
mail.smtp.port integer (>=1) The port to connect to, if not specified.
mail.smtp.connectiontimeout integer (>=1) Socket connection timeout, in milliseconds. Defaults to no timeout.
mail.smtp.timeout integer (>=1) Socket I/O timeout, in milliseconds. Defaults to no timeout.
mail.smtp.from RFC 822 address The mailbox to use for the SMTP MAIL command. If not set, the first InternetAddress in the From field of the message will be used, or failing that, InternetAddress.getLocalAddress().
mail.smtp.localhost IP address or hostname The host identifier for the local machine, to report in the EHLO/HELO command.
mail.smtp.ehlo boolean If set to false, service extensions negotiation will not be attempted.
mail.smtp.auth boolean If set to true, authentication will be attempted. Exceptionally, you may set this to the special value "required" to throw an exception on connect when authentication could not be performed.
mail.smtp.auth.mechanisms comma-delimited list of SASL mechanisms If set, only the specified SASL mechanisms will be attempted during authentication, in the given order. If not present, the SASL mechanisms advertised by the server will be used.
mail.smtp.dsn.notify string The RCPT NOTIFY option. Should be set to either "never", or one or more of "success", "failure", or "delay" (separated by commas and/or spaces). See RFC 3461 for details. This feature may not be supported by all servers.
mail.smtp.dsn.ret string The MAIL RET option. Should be set to "full" or "hdrs". See RFC 3461 for details. This feature may not be supported by all servers.
mail.smtp.tls boolean If set to false, TLS negotiation will not be attempted. Exceptionally, you may set this to the special value "required" to throw an exception on connect when TLS is not available.
mail.smtp.mtrk boolean If set to true, sends MTRK and ENVID parameters.
mail.smtp.mtrk.timeout integer If set, specified the number of seconds to request that the tracking information be retained on the server.
mail.smtp.trustmanager String The name of a class implementing the javax.net.ssl.TrustManager interface, which will be used to determine trust in TLS negotiation.