org.springframework.batch.item.mail.builder

## Class SimpleMailMessageItemWriterBuilder

- java.lang.Object
- - org.springframework.batch.item.mail.builder.SimpleMailMessageItemWriterBuilder

-     public class SimpleMailMessageItemWriterBuilder
      extends java.lang.Object

  Creates a fully qualified SimpleMailMessageItemWriter.
  Since:
    4.0
  Author:
    Glenn Renfro

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleMailMessageItemWriterBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SimpleMailMessageItemWriter` | `build()` Returns a fully constructed `SimpleMailMessageItemWriter`.
    `SimpleMailMessageItemWriterBuilder` | `mailErrorHandler(MailErrorHandler mailErrorHandler)` The handler for failed messages.
    `SimpleMailMessageItemWriterBuilder` | `mailSender(org.springframework.mail.MailSender mailSender)` A `MailSender` to be used to send messages in `SimpleMailMessageItemWriter.write(List)`.

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

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

- - ### Constructor Detail

    - #### SimpleMailMessageItemWriterBuilder

          public SimpleMailMessageItemWriterBuilder()

  - ### Method Detail

    - #### mailSender

          public SimpleMailMessageItemWriterBuilder mailSender(org.springframework.mail.MailSender mailSender)

      A `MailSender` to be used to send messages in `SimpleMailMessageItemWriter.write(List)`.
      Parameters:
        `mailSender` - strategy for sending simple mails.
      Returns:
        this instance for method chaining.
      See Also:
        `SimpleMailMessageItemWriter.setMailSender(MailSender)`

    - #### mailErrorHandler

          public SimpleMailMessageItemWriterBuilder mailErrorHandler(MailErrorHandler mailErrorHandler)

      The handler for failed messages. Defaults to a `DefaultMailErrorHandler`.
      Parameters:
        `mailErrorHandler` - the mail error handler to set.
      Returns:
        this instance for method chaining.
      See Also:
        `SimpleMailMessageItemWriter.setMailErrorHandler(MailErrorHandler)`

    - #### build

          public SimpleMailMessageItemWriter build()

      Returns a fully constructed `SimpleMailMessageItemWriter`.
      Returns:
        a new `SimpleMailMessageItemWriter`