Package org.opencms.mail
Class CmsMailSettings
java.lang.Object
org.opencms.mail.CmsMailSettings
Contains the settings for the OpenCms mail service.
- Since:
- 6.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new mail host to the internal list of mail hosts with default port 25.voidaddMailHost(String hostname, String port, String order, String protocol, String security, String username, String password) Adds a new mail host to the internal list of mail hosts.voidaddMailHost(String hostname, String port, String order, String protocol, String security, String username, String password, String id, String mailfrom) Adds a new mail host to the internal list of mail hosts.Returns the default mail host.Returns the mail from default sender.getMailHost(String id) Returns a mail host for a given id.Returns an unmodifiable sorted list of all configured mail hosts.voidsetMailFromDefault(String sender) Sets the mail from default sender.toString()
-
Field Details
-
MAIL_DEFAULT_PROTOCOL
The default protocol for sending mail ("smtp").- See Also:
-
MAIL_DEFAULT_SENDER
The default mail from address.- See Also:
-
-
Constructor Details
-
CmsMailSettings
public CmsMailSettings()Empty constructor, required for configuration.
-
-
Method Details
-
addMailHost
public void addMailHost(String hostname, String order, String protocol, String username, 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(String hostname, String port, String order, String protocol, String security, String username, 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
-
addMailHost
public void addMailHost(String hostname, String port, String order, String protocol, String security, String username, String password, String id, String mailfrom) 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 authenticationid- the id of the mail hostmailfrom- the mail-from address of the mail host
-
getDefaultMailHost
Returns the default mail host.- Returns:
- the default mail host
-
getMailFromDefault
Returns the mail from default sender.- Returns:
- the mail from default sender
-
getMailHost
Returns a mail host for a given id.- Parameters:
id- the id- Returns:
- the mail host
-
getMailHosts
Returns an unmodifiable sorted list of all configured mail hosts.- Returns:
- an unmodifiable sorted list of all configured mail hosts
-
setMailFromDefault
Sets the mail from default sender.- Parameters:
sender- the mail from default sender to set
-
toString
-