io.vertx.ext.mail

## Class SMTPException

- java.lang.Object
- - java.lang.Throwable
  - - io.vertx.core.impl.NoStackTraceThrowable
    - - io.vertx.ext.mail.SMTPException

- All Implemented Interfaces:
    Serializable

      public class SMTPException
      extends io.vertx.core.impl.NoStackTraceThrowable

  This represents an Exception during communication with SMTP server.
  Author:
    Lin Gao
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SMTPException(String message, int replyCode, List<String> replyMessages)` Constructor of SMTPException.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getReplyCode()` Gets the SMTP reply status code.
    `String` | `getReplyMessage()` Gets the SMTP reply message.
    `List<String>` | `getReplyMessages()` Gets the SMTP reply messages.
    `boolean` | `isPermanent()` Checks if it is a permanent failure, that the reply status code `>=` 500
    `boolean` | `isTransient()` Checks if it is a transient failure, that the reply status code `>=` 400 and `<` 500

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SMTPException

          public SMTPException(String message,
                               int replyCode,
                               List<String> replyMessages)

      Constructor of SMTPException.
      Parameters:
        `message` - the informative message prepending the reply messages
        `replyCode` - the SMTP reply code
        `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.

Copyright © 2022 Eclipse. All rights reserved.