public class CmsMailSettings extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAIL_DEFAULT_PROTOCOL
The default protocol for sending mail ("smtp").
|
static java.lang.String |
MAIL_DEFAULT_SENDER
The default mail from address.
|
Constructor and Description |
---|
CmsMailSettings()
Empty constructor, required for configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addMailHost(java.lang.String hostname,
java.lang.String order,
java.lang.String protocol,
java.lang.String username,
java.lang.String password)
Adds a new mail host to the internal list of mail hosts with default port 25.
|
void |
addMailHost(java.lang.String hostname,
java.lang.String port,
java.lang.String order,
java.lang.String protocol,
java.lang.String username,
java.lang.String password)
Adds a new mail host to the internal list of mail hosts.
|
CmsMailHost |
getDefaultMailHost()
Returns the default mail host.
|
java.lang.String |
getMailFromDefault()
Returns the mail from default sender.
|
java.util.List<CmsMailHost> |
getMailHosts()
Returns an unmodifiable sorted list of all configured mail hosts.
|
void |
setMailFromDefault(java.lang.String sender)
Sets the mail from default sender.
|
java.lang.String |
toString() |
public static final java.lang.String MAIL_DEFAULT_PROTOCOL
public static final java.lang.String MAIL_DEFAULT_SENDER
public CmsMailSettings()
public void addMailHost(java.lang.String hostname, java.lang.String order, java.lang.String protocol, java.lang.String username, java.lang.String password)
hostname
- the name of the mail hostorder
- the order in which the host is triedprotocol
- the protocol to use (default "smtp")username
- the user name to use for authenticationpassword
- the password to use for authenticationpublic void addMailHost(java.lang.String hostname, java.lang.String port, java.lang.String order, java.lang.String protocol, java.lang.String username, java.lang.String password)
hostname
- the name of the mail hostport
- the port of the mail hostorder
- the order in which the host is triedprotocol
- the protocol to use (default "smtp")username
- the user name to use for authenticationpassword
- the password to use for authenticationpublic CmsMailHost getDefaultMailHost()
public java.lang.String getMailFromDefault()
public java.util.List<CmsMailHost> getMailHosts()
public void setMailFromDefault(java.lang.String sender)
sender
- the mail from default sender to setpublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()