使用Thymeleaf发送HTML邮件
新建一个mail模板
<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<link rel="icon" href="https://static.nowcoder.com/images/logo_87_87.png"/>
<title>牛客网-激活账号</title>
</head>
<body>
<div>
<p>
<b>xxx@xxx.com</b>, 您好!
</p>
<p>
您正在注册牛客网, 这是一封激活邮件, 请点击
<a href="#">http://www.nowcoder.com/activation/abcdefg123456.html</a>,
激活您的牛客账号!
</p>
</div>
</body>
</html>
测试
主动调用Template模板引擎
给模板传参用context,设置其参数
调用模板引擎的proces的方法,指定其方法和数据
接受其生成的动态网页即字符串
@Test
public void test