【发布时间】:2016-07-05 18:35:59
【问题描述】:
我正在使用 Thymeleaf 模板生成 HTML 页面,然后将其用作电子邮件的内容。所需的字体系列是 Calibri。但是,当生成 HTML 文档(然后作为电子邮件发送)时,检索到的包含此文档的电子邮件不包含 Calibri 中的字体。但是,如果我删除了 Thymeleaf 相关元素并在浏览器中将页面作为普通 HTML 页面启动,它确实会在 Calibri 中显示内容。有谁知道问题可能出在哪里?提前致谢!
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<link href='http://fonts.googleapis.com/css?family=Calibri'
rel='stylesheet' type='text/css' />
<style>
body {
font-family: 'Calibri', serif;
font-size: 11pt;
}
</style>
</head>
<body>
<p style="line-height:25pt;">
We from <span th:text="${nameCompany}"></span> are sending you an email.
</p>
</body>
</html>
【问题讨论】:
-
您应该使用代码的语法。有时 tyhmleaf 不接受浏览器理解的语法。
-
您尝试过提供的解决方案吗?