添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
添加配置文件
stmp.host=smtp.163.com
stmp.account=xxxxxxx@163.com
stmp.password=*********
mail.smtp.auth=true
mail.smtp.timeout=25000
创建实体
public class MyEmail {
private String receiver;
private String subject;
private String text;
private String content;
public String getReceiver() {
return receiver;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
}
public String getSubject() {