Package org.opencms.mail
Class CmsMailSettings
- java.lang.Object
-
- org.opencms.mail.CmsMailSettings
-
public class CmsMailSettings extends java.lang.Object
Contains the settings for the OpenCms mail service.- Since:
- 6.0.0
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description CmsMailSettings()
Empty constructor, required for configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 security, 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()
-
-
-
Field Detail
-
MAIL_DEFAULT_PROTOCOL
public static final java.lang.String MAIL_DEFAULT_PROTOCOL
The default protocol for sending mail ("smtp").- See Also:
- Constant Field Values
-
MAIL_DEFAULT_SENDER
public static final java.lang.String MAIL_DEFAULT_SENDER
The default mail from address.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsMailSettings
public CmsMailSettings()
Empty constructor, required for configuration.
-
-
Method Detail
-
addMailHost
public 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.- Parameters:
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 authentication
-
addMailHost
public void addMailHost(java.lang.String hostname, java.lang.String port, java.lang.String order, java.lang.String protocol, java.lang.String security, java.lang.String username, java.lang.String password)
Adds a new mail host to the internal list of mail hosts.- Parameters:
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")security
- the security modeusername
- the user name to use for authenticationpassword
- the password to use for authentication
-
getDefaultMailHost
public CmsMailHost getDefaultMailHost()
Returns the default mail host.- Returns:
- the default mail host
-
getMailFromDefault
public java.lang.String getMailFromDefault()
Returns the mail from default sender.- Returns:
- the mail from default sender
-
getMailHosts
public java.util.List<CmsMailHost> getMailHosts()
Returns an unmodifiable sorted list of all configured mail hosts.- Returns:
- an unmodifiable sorted list of all configured mail hosts
-
setMailFromDefault
public void setMailFromDefault(java.lang.String sender)
Sets the mail from default sender.- Parameters:
sender
- the mail from default sender to set
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
-