加入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
记得还要打开邮箱的smtp接口,并获得到邮箱的授权码作为你的密码配置
mail:
subject: "XXXXXXXX"
from: abc@163.com
spring.mail:
host: smtp.163.com
username: abc
password: EdsfdfsdfsfsfssdfsdfYV # 授权码
properties.mail:
smtp:
auth: true