class SimpleMailMessageItemWriterBuilder {

	private MailSender mailSender;

	private MailErrorHandler mailErrorHandler = new DefaultMailErrorHandler();

	/**
	 * A {@link MailSender} to be used to send messages in
	 * {@link SimpleMailMessageItemWriter#write(Chunk)}.
	 * @param mailSender strategy for sending simple mails.
	 * @return this instance for method chaining.
	 * @see SimpleMailMessageItemWriter#setMailSender(MailSender)
	 */
	public SimpleMailMessageItemWriterBuilder mailSender(MailSender mailSender) {
		this.mailSender = mailSender;
		return this;
	}

	/**
	 * The handler for failed messages. Defaults to a {@link DefaultMailErrorHandler}.
	 * @param mailErrorHandler the mail error handler to set.
	 * @return this instance for method chaining.
	 * @see SimpleMailMessageItemWriter#setMailErrorHandler(MailErrorHandler)
	 */
	public SimpleMailMessageItemWriterBuilder mailErrorHandler(MailErrorHandler mailErrorHandler) {
		this.mailErrorHandler = mailErrorHandler;
		return this;
	}

	/**
	 * Returns a fully constructed {@link SimpleMailMessageItemWriter}.
	 * @return a new {@link SimpleMailMessageItemWriter}
	 */
	public SimpleMailMessageItemWriter build() {<FILL_FUNCTION_BODY>}

}

		Assert.notNull(this.mailSender, "A mailSender is required");

		SimpleMailMessageItemWriter writer = new SimpleMailMessageItemWriter();
		writer.setMailSender(this.mailSender);
		if (mailErrorHandler != null) {
			writer.setMailErrorHandler(this.mailErrorHandler);
		}

		return writer;
	
<no_super_class>