<?xml version="1.0" encoding="UTF-8"?>
<!-- 
修改说明:
	1.修改javaMailSender连接邮件服务器相关配置
	2.修改simpleMailMessageTemplate的默认from
 -->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://www.springframework.org/schema/beans 
	http://www.springframework.org/schema/beans/spring-beans-3.1.xsd"
	default-autowire="byName" default-lazy-init="true">
	
	<!-- 邮件消息模板,指定一些邮件的默认值 -->
	<bean id="simpleMailMessageTemplate" class="org.springframework.mail.SimpleMailMessage">
		<property name="from" value="${mail.from}"></property>
	</bean>
	
	<!-- 普通的JavaMailSender -->
	<bean id="javaMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
		<property name="host" value="${mail.server}" />
		<property name="username" value="${mail.server.user}" />
		<property name="password" value="${mail.server.password}" />
		<property name="defaultEncoding" value="UTF-8" />
		
		<property name="javaMailProperties">
			<props>
				<prop key="mail.smtp.auth">true</prop>
			</props>
		</property>
	</bean>

    <!-- AsyncTokenFactory可以为AsyncToken指定默认的responders -->
	<bean id="mailerAsyncTokenFactory" class="com.cloudcross.ssp.base.utils.concurrent.async.DefaultAsyncTokenFactory">
		<property name="responders">
			<list></list>
		</property>
	</bean>
	
	<!-- 异步的JavaMailSender -->
	<bean id="asyncJavaMailSender" class="com.cloudcross.ssp.base.utils.mail.AsyncJavaMailSender">
		<!-- 邮件发送的线程池大小 -->
		<property name="sendMailThreadPoolSize" value="3" />
		<property name="javaMailSender" ref="javaMailSender" />
		<property name="asyncTokenFactory" ref="mailerAsyncTokenFactory"></property>
    </bean>
    
<!-- 	component-scan自动搜索@Component , @Controller , @Service , @Repository等标注的类
	<context:component-scan base-package="com.**.mailer"/> -->	
</beans>
