我想在 ozimov spring boot 电子邮件工具中发送没有任何模板的 HTML 电子邮件。当我尝试像这样使用 DefaultEmail 时:
final Email email = DefaultEmail.builder()
.from(new InternetAddress("anyone@example.com", "Anyone"))
.to(Lists.newArrayList(managerMailAddress)).subject("Test")
.body(mailBody).encoding("UTF-8").build();
但这很糟糕。发送此邮件时,所有 html 标记都会显示在邮件中。那么如何发送 HTML 电子邮件呢?