public class SmtpServer<T extends SmtpServer<T>> extends MailServer<SendMailSession>
MailServer.Builder| Modifier and Type | Field and Description |
|---|---|
protected boolean |
debug
Whether debug mode is enabled.
|
protected static int |
DEFAULT_SMTP_PORT
Default SMTP port
|
static java.lang.String |
MAIL_DEBUG |
static java.lang.String |
MAIL_HOST |
static java.lang.String |
MAIL_MIME_ADDRESS_STRICT |
static java.lang.String |
MAIL_SMTP_AUTH |
static java.lang.String |
MAIL_SMTP_CONNECTIONTIMEOUT |
static java.lang.String |
MAIL_SMTP_FROM |
static java.lang.String |
MAIL_SMTP_HOST |
static java.lang.String |
MAIL_SMTP_PORT |
static java.lang.String |
MAIL_SMTP_TIMEOUT |
static java.lang.String |
MAIL_SMTP_WRITETIMEOUT |
static java.lang.String |
MAIL_TRANSPORT_PROTOCOL |
protected static java.lang.String |
PROTOCOL_SMTP |
protected boolean |
strictAddress
Whether strict address checking is turned on.
|
| Constructor and Description |
|---|
SmtpServer(java.lang.String host,
int port,
javax.mail.Authenticator authenticator) |
| Modifier and Type | Method and Description |
|---|---|
protected T |
_this() |
SendMailSession |
createSession()
Creates new mail session.
|
protected java.util.Properties |
createSessionProperties()
Creates
MailSession Properties. |
T |
debugMode(boolean debug)
Enable or disable debug mode.
|
protected javax.mail.Transport |
getTransport(javax.mail.Session session)
Get the
Transport for Session. |
T |
strictAddress(boolean strictAddress)
Disables the strict address.
|
T |
timeout(int timeout)
Defines timeout value in milliseconds for all mail-related operations.
|
create, getAuthenticator, getHost, getPort, getSessionPropertiespublic static final java.lang.String MAIL_HOST
public static final java.lang.String MAIL_SMTP_HOST
public static final java.lang.String MAIL_SMTP_PORT
public static final java.lang.String MAIL_SMTP_AUTH
public static final java.lang.String MAIL_TRANSPORT_PROTOCOL
public static final java.lang.String MAIL_SMTP_FROM
public static final java.lang.String MAIL_SMTP_CONNECTIONTIMEOUT
public static final java.lang.String MAIL_SMTP_TIMEOUT
public static final java.lang.String MAIL_SMTP_WRITETIMEOUT
public static final java.lang.String MAIL_DEBUG
public static final java.lang.String MAIL_MIME_ADDRESS_STRICT
protected static final java.lang.String PROTOCOL_SMTP
protected static final int DEFAULT_SMTP_PORT
protected boolean debug
protected boolean strictAddress
public SmtpServer(java.lang.String host,
int port,
javax.mail.Authenticator authenticator)
protected T _this()
public T timeout(int timeout)
timeout - timeout value in milliseconds.public T debugMode(boolean debug)
debug - true to turn on debugging. By default, this is false.public T strictAddress(boolean strictAddress)
strictAddress - true if strict address checking should be be turned on. By default, this is true.protected java.util.Properties createSessionProperties()
MailServerMailSession Properties.createSessionProperties in class MailServer<SendMailSession>Propertiespublic SendMailSession createSession()
createSession in class MailServer<SendMailSession>SendMailSessionprotected javax.mail.Transport getTransport(javax.mail.Session session)
throws javax.mail.NoSuchProviderException
Transport for Session.session - The SendMailSession.Transport.javax.mail.NoSuchProviderException - If provider for the given protocol is not found.Copyright © 2003-present Jodd Team