依赖配置:
<!-- mail start -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
配置文件:
### mail邮件配置
spring.mail.host=smtp.xxx.com.cn
[email protected]
spring.mail.password=xxxx
spring.mail.default-encoding=UTF-8
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
举例:
http://www.qchcloud.cn/system/article/show/71
原文地址:http://blog.51cto.com/14042154/2330251
时间: 2024-10-10 20:16:16