Class SMTPRelay

  • Direct Known Subclasses:
    ErrorRelay

    public class SMTPRelay
    extends Object
    Definition of an SMTP server that allows jadice server to send outgoing Messages.

    Secure transport can be enforced by configuring an SMTPS connection and applying additional session parameters as described in the javamail documentation.

    Since:
    jadice server 4.2.1.6
    • Constructor Detail

      • SMTPRelay

        public SMTPRelay()
    • Method Detail

      • getHostname

        public String getHostname()
      • setHostname

        public void setHostname​(String hostname)
        Set the SMTP host where to connect to
        Parameters:
        hostname - hostname, must not be null.
        Throws:
        IllegalArgumentException - if hostname is null.
      • getProtocol

        public String getProtocol()
      • setProtocol

        public void setProtocol​(String protocol)
        Alters the transport protocol. smtp or smtps are reasonable values. Default value: smtp
        Parameters:
        protocol - the transport protocol to use
        Throws:
        IllegalArgumentException - if protocol is null.
        Since:
        jadice server 5.1.5.0
      • getUsername

        public String getUsername()
      • setUsername

        public void setUsername​(String username)
      • getPassword

        public String getPassword()
      • setPassword

        public void setPassword​(String password)
      • getAddress

        public javax.mail.internet.InternetAddress getAddress()
      • setAddress

        public void setAddress​(javax.mail.internet.InternetAddress address)
      • setAddressAsString

        public void setAddressAsString​(String address)
                                throws javax.mail.internet.AddressException
        Throws:
        javax.mail.internet.AddressException
      • getAddressAsString

        public String getAddressAsString()
      • getAdditionalSessionProperties

        public Map<String,​String> getAdditionalSessionProperties()
      • setAdditionalSessionProperties

        public void setAdditionalSessionProperties​(Map<String,​String> props)
        Apply additional parameters to the underlying javamail Session.
        Parameters:
        props - additional properties
        Throws:
        IllegalArgumentException - if props is null.
        Since:
        jadice server 5.1.5.0
        See Also:
        javamail documentation
      • send

        public void send​(javax.mail.internet.MimeMessage message)
                  throws javax.mail.MessagingException
        Send a message via the specified connection and parameters.
        Parameters:
        message - the message to send
        Throws:
        javax.mail.MessagingException - if communication fails
        IllegalArgumentException - if message is null
      • getSession

        public javax.mail.Session getSession()