如何处理静态HTML代码?
通常我在文件中有html代码。
@Autowired
private TemplateEngine templateEngine;
@Override
public void sendMail(){
...
String body = this.templateEngine.process(templateName, context);
// String body = this.templateEngine.process("<html>...</html>",context);
final MimeMessage mimeMessage = this.mailSender.createMimeMessage();
final MimeMessageHelper compose = new MimeMessageHelper(mimeMessage, StandardCharsets.UTF_8.toString());
...
this.mailSender.send(mimeMessage);
}