GitHub
src="//ghbtns.com/github-btn.html?user=je-ge&repo=spring-boot&type=watch&count=true" scrolling="0" width="110" height="20">需求产生
发送邮件的需求比较常见,如找回密码、事件通知等
添加Maven email依赖包
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
修改配置文件application.properties
#Spring集成邮件发送的相关配置
#使用163邮箱,修改自己的邮箱帐号和密码
#spring.mail.host=smtp.163.com
#spring.mail.username=username@163.com
#spring.mail.password=password
#如果使用qq邮箱,修改自己的邮箱帐号和授权码
spring.mail.host