Class MailSendException

Direct Known Subclasses:
MailAuthenticationException

public class MailSendException extends MailException
A mail the server refused, with the reply it gave.
  • Constructor Details

    • MailSendException

      public MailSendException(String message, int code, boolean permanent)
      • code: the three-digit SMTP reply code, an HTTP status from a provider's API, or 0 when there was none
      • permanent: whether the server will give the same answer next time. The transport decides: an SMTP 4xx means "later" and an HTTP 4xx mostly means "never", so the number alone does not say.
  • Method Details

    • getCode

      public int getCode()
      The server's reply code, or 0.
    • isPermanent

      public boolean isPermanent()
      Description copied from class: MailException
      Whether sending the same mail again can never succeed: the server answered with a permanent refusal. A failure that is not permanent -- a timeout, a dropped connection, a "try again later" -- is retried.
      Overrides:
      isPermanent in class MailException