0.发送邮件准备
参数:
mail.host =XXXX.163.com
mail.username = XXXXX
mail.password = XXXX
配置文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="${mail.host}"></property>
<property name="javaMailProperties">
<props>
<prop key="mail.smtp.auth">true</prop>
<prop key="mail.smtp.timeout">25000</prop>
</props>
</property>
<property name="username" value="${mail.username}"></property>
<property name="password" value="${mail.password}"></property>
</bean>
</beans>
pom.xml依赖包:
<!-- 发送邮件 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
1.填写信息
//提交,最终验证。
var isSure = true;//保证确认按钮不能重复点击
$('#submit1').click(function(){ $(".find-form1 :input").trigger('blur'); var numError = $('.find-form1 .red').length;//验证手机号、邮箱、姓名是否符合标准 if(numError==