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.

Class Summary

SMTPTransport This transport handles communications with an SMTP server.
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.

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.trustmanager String The name of a class implementing the javax.net.ssl.TrustManager interface, which will be used to determine trust in TLS negotiation.