<!-- mail -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
yml配置
spring:
mail:
host: smtp.163.com
port: 465
protocol: smtp
test-connection: false
default-encoding: UTF-8
username: xxx@163.com
password: 123456
properties:
mail:
imap:
ssl:
socketFactory:
fallback: false
smtp:
ssl:
enable: true
socketFactory:
class: com.fintech.modules.util.MailSSLSocketFactory
auth : true
timeout : 2000
starttls:
enable : true
required : true