Class SMTPException

    • Constructor Detail

      • SMTPException

        public SMTPException​(String message,
                             int replyCode,
                             List<String> replyMessages,
                             boolean supportEnhancementStatusCode)
        Constructor of SMTPException.
        Parameters:
        message - the informative message prepending the reply messages
        replyCode - the SMTP reply code
        supportEnhancementStatusCode - if ENHANCEDSTATUSCODES is supported or not
        replyMessages - the SMTP reply messages
    • Method Detail

      • getReplyCode

        public int getReplyCode()
        Gets the SMTP reply status code.
        Returns:
        the SMTP reply status code.
      • getReplyMessages

        public List<String> getReplyMessages()
        Gets the SMTP reply messages. It maybe multi lines messages splits by \n
        Returns:
        the SMTP reply messages
      • getReplyMessage

        public String getReplyMessage()
        Gets the SMTP reply message. In case of multi lines messages, returns the first line.
        Returns:
        the SMTP reply message
      • isPermanent

        public boolean isPermanent()
        Checks if it is a permanent failure, that the reply status code >= 500
        Returns:
        true if it is a permanent failure, false otherwise.
      • isTransient

        public boolean isTransient()
        Checks if it is a transient failure, that the reply status code >= 400 and < 500
        Returns:
        true if it is a transient failure, false otherwise.