<?xml version="1.0" encoding="UTF-8"?>
<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.xsd
		">
	<!-- 这配置文件大都也是固定的,只要找到一个这样的模板,然后清楚里面的每个参数是代表的什么意思,根据实际情况更改就行了.-->
	<!-- 将发送邮件的对象配置为Spring的Bean -->
	<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
		<!-- 邮件服务器主机 -->
		<property name="host" value="smtp.126.com"/>
		<!-- 设置用户名 -->
		<property name="username" value="itcast0228"/>
		<!-- 设置密码 -->
		<property name="password" value="0228itcast"/>
		<!-- 邮件属性 -->
		<property name="javaMailProperties">
		<!-- 说一下这个props标签,现在就在两个文件中用到了这个props标签 -->
		<!--
		<property name="hibernateProperties">
		一个是applicationContext.xml中的关于配置
			<props>
				<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
				<prop key="hibernate.show_sql">true</prop>
				<prop key="hibernate.format_sql">false</prop>
			</props>
		-->
			<props>
				<!-- 开启验证 -->
				<prop key="mail.smtp.auth">true</prop>
				<!-- SMTP协议加密方式 -->
				<prop key="mail.smtp.starttls.enable">true</prop>
				<!-- 超时时间 -->
				<prop key="mail.smtp.timeout">10000</prop>
			</props>
		</property>
	</bean>
</beans>

  

applicationContext-mail.xml 模板的更多相关文章

  1. 怎样给Eclipse添加一个Xml模板

    1.找到Window/Preferences/XML/XML Files/Editor/Templates 2.新建一个模板,设置一个名称并且在Pattern中设置自己的XML模板就可以了,同时支持导 ...

  2. 使用freemarker生成xml模板

    今天在java交流群里有个人问我如何用freemarker生成xml模板文件,可以手动配置参数,于是我到网上百度了一下.发现有一位同行的博文写的很nice,于是我就照着他的代码敲了一遍,最后实现了,本 ...

  3. 记录一下自己常用的maven工程的pom.xml模板

    1. 带有hadoop-CDH4.2.1的pom.xml模板 <?xml version="1.0" encoding="UTF-8"?> < ...

  4. c3p0-config.xml模板详解

    c3p0-config.xml模板详解 <c3p0-config> <default-config> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数.De ...

  5. applicationContext.xml 模板

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  6. ApplicationContext.xml模板

      <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www. ...

  7. 【文件】使用word的xml模板生成.doc文件

    一.编辑模板 替换地方以变量标记如“案件编号”可写成{caseNo} template.xml 二.准备数据 以HashMap封装数据,原理是替换模板中的变量 三.替换操作 选择输出位置:writeP ...

  8. springboot mail+Thymeleaf模板

    compile 'org.springframework.boot:spring-boot-starter-thymeleaf' compile 'io.ratpack:ratpack-thymele ...

  9. spring-service.xml 模板

    ssm模板 <?xml version="1.0" encoding="UTF-8"?>  <beans xmlns="http:/ ...

随机推荐

  1. Test Spring el with ExpressionParser

    Spring expression language (SpEL) supports many functionality, and you can test those expression fea ...

  2. Spring入门(10)-Spring JDBC

    Spring入门(10)-Spring JDBC 0. 目录 JdbcTemplate介绍 JdbcTemplate常见方法 代码示例 参考资料 1. JdbcTemplate介绍 JdbcTempl ...

  3. Spring MVC Framework 实例

    一 SpringMVC基础入门,创建一个HelloWorld程序 1 首先,导入SpringMVC需要的jar包. commons-logging-<version>.jar spring ...

  4. [0.1]Plan of kidsearch

    To be honest, it's not pretty easy to complete the project. So we have to sort out ideas first. In t ...

  5. Linux - CentOS 6.3 (x86_64)安装过程详细图解

    I:下载CentOS 6.3 楼主已经从CentOS官方公布下载列表当中整理出了2个在国内的下载地址,这样就不需要为访问墙外的龟速网络而费心了. 32位:下载地址1,下载地址2 64位:下载地址1,下 ...

  6. android常见错误--Unable to resolve target ‘android - 8’

    这是由于项目的android的版本没有设置好,解决方法如下: 1,clean项目 选择[project]-[clean] 选中需要进行clean的项目,点击[ok] 2,重新build 选择[proj ...

  7. IOS 7 开发范例 - UISwitch的使用

    Creating and Using Switches with UISwitch You would like to give your users the ability to turn an o ...

  8. Codeforces Gym 100002 Problem F "Folding" 区间DP

    Problem F "Folding" Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/ ...

  9. pjsip视频通信开发(上层应用)之数字键盘的制作

    在pjsip视频通信开发(上层应用)之EditText重写中我制作了一个显示输入内容的EditText,这里将制作一个数字键盘,其实跟计算器一样,最多的就是用TableLayout来实现,内部通过权重 ...

  10. string <-> wstring

    // std::string -> std::wstringstd::string s("string");std::wstring ws;ws.assign(s.begin ...