Class CmsMailSettings

java.lang.Object
org.opencms.mail.CmsMailSettings

public class CmsMailSettings extends Object
Contains the settings for the OpenCms mail service.

Since:
6.0.0
  • Field Details

  • 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 host
      order - the order in which the host is tried
      protocol - the protocol to use (default "smtp")
      username - the user name to use for authentication
      password - 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 host
      port - the port of the mail host
      order - the order in which the host is tried
      protocol - the protocol to use (default "smtp")
      security - the security mode
      username - the user name to use for authentication
      password - 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 host
      port - the port of the mail host
      order - the order in which the host is tried
      protocol - the protocol to use (default "smtp")
      security - the security mode
      username - the user name to use for authentication
      password - the password to use for authentication
      id - the id of the mail host
      mailfrom - 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

      public void setMailFromDefault(String sender)
      Sets the mail from default sender.

      Parameters:
      sender - the mail from default sender to set
    • toString

      public String toString()
      Overrides:
      toString in class Object
      See Also: