<?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. mysql注册服务

    http://www.2cto.com/database/201301/185456.html ____________________________________________________ ...

  2. Android实例-程序切换到后台及从后台切换到前台

    相关资料: http://www.delphitop.com/html/Android/2933.html 程序包下载: http://download.csdn.net/detail/zhujian ...

  3. HDU 5795 A Simple Nim (博弈 打表找规律)

    A Simple Nim 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5795 Description Two players take turns ...

  4. Codeforces Round #149 (Div. 2) E. XOR on Segment (线段树成段更新+二进制)

    题目链接:http://codeforces.com/problemset/problem/242/E 给你n个数,m个操作,操作1是查询l到r之间的和,操作2是将l到r之间的每个数xor与x. 这题 ...

  5. HDU1874畅通工程续(floyd||dijkstra)

    看了看floyd和dijkstra,然后就找了两个练习来捉 #include<iostream> #include<stdio.h> #include<string.h& ...

  6. UVaLive 6859 Points (几何,凸包)

    题意:给定 n 个点,让你用最长的周长把它们严格包围起来,边长只能用小格子边长或者是小格子对角线. 析:先把每个点的上下左右都放到一个集合中,然后求出一个凸包,然后先边长转成题目的方式,也好转两个点的 ...

  7. linux知识积累

                                                         linux 操作系统一.linux 操作系统概述   简介            Linux是 ...

  8. twisted 安装时,安装顺序为 zope.interface ->twisted

    最近想学 twisted ,就去下载 twisted 的windows版本,并且 安装.运行 twisted 例子后,发现出现了问题: ImportError: Twisted requires zo ...

  9. 在Mac OS X 10.9上安装nginx

    1. 安装PCRE Download latest PCRE. After download go to download directory from terminal. $ cd ~/Downlo ...

  10. POJ 3281 Dining 网络流最大流

    B - DiningTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.ac ...