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, and/or message tracking (MTRK) as specified in RFC 3885.

The provider supports the following session properties:

NameTypeDescription
mail.smtp.hostIP address or hostnameThe SMTP server to connect to
mail.smtp.portinteger (>=1)The port to connect to, if not specified.
mail.smtp.connectiontimeoutinteger (>=1)Socket connection timeout, in milliseconds. Defaults to no timeout.
mail.smtp.timeoutinteger (>=1)Socket I/O timeout, in milliseconds. Defaults to no timeout.
mail.smtp.fromRFC 822 addressThe 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.localhostIP address or hostnameThe host identifier for the local machine, to report in the EHLO/HELO command.
mail.smtp.ehlobooleanIf set to false, service extensions negotiation will not be attempted.
mail.smtp.authbooleanIf 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.mechanismscomma-delimited list of SASL mechanismsIf 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.notifystringThe 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.retstringThe 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.tlsbooleanIf 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.mtrkbooleanIf set to true, sends MTRK and ENVID parameters.
mail.smtp.mtrk.timeoutintegerIf set, specified the number of seconds to request that the tracking information be retained on the server.
mail.smtp.trustmanagerStringThe name of a class implementing the javax.net.ssl.TrustManager interface, which will be used to determine trust in TLS negotiation.

© Copyright 2003, 2004 The Free Software Foundation, All rights reserved