我正在使用 velocity 模板来格式化邮件正文。我有以下文件。
示例.vm
<html>
<body>
This is an error email<p/> //This text should be in bold
${exceptionDetails} //This exception details should be in RED font.
</body>
</html>
如何将文本设置为粗体并将异常详细信息设置为红色?
请帮帮我。
谢谢!
最佳答案
您应该使用样式声明来实现这一点。
像这样:
<html>
<body>
<span style="font-weight:bold">
This is an error email<p/> //This text should be in bold
</span>
<span style="color:red">
${exceptionDetails} //This exception details should be in RED font.
</span>
</body>
</html>
您可以阅读更多相关信息 here .
When you're coding an HTML email with CSS, make sure that you don't use linked CSS files (.css files attached using link or @import). These are the stylesheets most widely ignored by email clients.
.....
关于java - 使用速度模板格式化电子邮件正文?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19496755/