<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	   xmlns:int="http://www.springframework.org/schema/integration"
	   xmlns:int-mail="http://www.springframework.org/schema/integration/mail"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
	http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/integration/mail https://www.springframework.org/schema/integration/mail/spring-integration-mail.xsd">

	<bean id="javaMailSender" class="org.springframework.integration.mail.StubJavaMailSender">
		<constructor-arg>
			<bean class="jakarta.mail.internet.MimeMessage">
				<constructor-arg type="jakarta.mail.Session">
					<null/>
				</constructor-arg>
			</bean>
		</constructor-arg>
	</bean>

	<bean id="mailSendingMessageConsumer" class="org.springframework.integration.mail.MailSendingMessageHandler">
		<constructor-arg ref="javaMailSender"/>
	</bean>

	<int:chain input-channel="sendMailOutboundChainChannel">
		<int-mail:outbound-channel-adapter id="mail-outbound-channel-adapter-within-chain" mail-sender="javaMailSender"/>
	</int:chain>

	<bean id="mailSender" class="org.springframework.integration.mail.StubMailSender"/>

	<int-mail:outbound-channel-adapter id="simpleEmailChannel" mail-sender="mailSender"/>

</beans>
