1

How can I process a static html code?

Normally I have the html code in a file.

    @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);
}
michele
  • 26,348
  • 30
  • 111
  • 168

0 Answers0