org.springframework.batch.item.mail

## Interface MailErrorHandler

- All Known Implementing Classes:
    DefaultMailErrorHandler, TestMailErrorHandler

      public interface MailErrorHandler

  This class is used to handle errors that occur when email messages are unable to be sent.
  Since:
    2.1
  Author:
    Dan Garrette, Dave Syer

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `handle(org.springframework.mail.MailMessage message, java.lang.Exception exception)` This method will be called for each message that failed sending in the chunk.

- - ### Method Detail

    - #### handle

          void handle(org.springframework.mail.MailMessage message,
                      java.lang.Exception exception)
               throws org.springframework.mail.MailException

      This method will be called for each message that failed sending in the chunk. If the failed message is needed by the handler it will need to be downcast according to its runtime type. If an exception is thrown from this method, then it will propagate to the caller.
      Parameters:
        `message` - the failed message
        `exception` - the exception that caused the failure
      Throws:
        `org.springframework.mail.MailException` - if the exception cannot be handled