依赖
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.6.3</version>
</dependency>
resource根目录下配置mail.setting
host=smtp邮箱地址
port=25 默认25,可以不设置
from=从哪个邮箱发送
pass=smtp密码
java代码
MailUtil.send("收件人地址","邮件标题","邮件内容",false 是否为HTML);