1

I want to send HTML email without any template in ozimov spring boot email tools. When I try to use DefaultEmail like this:

final Email email = DefaultEmail.builder()
                .from(new InternetAddress("anyone@example.com", "Anyone"))
                .to(Lists.newArrayList(managerMailAddress)).subject("Test")
                .body(mailBody).encoding("UTF-8").build();

But this sucks. When sent this, All html tags are shown in the mail. So how can I send an HTML email?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
batur
  • 46
  • 6
  • Have you read the documentation on https://github.com/ozimov/spring-boot-email-tools/? For a similar fragment it says _"The previous code will send a plain text message. To obtain some more dynamic fancy emails, you have two options: i) the former and easier-to-use is to use a templatefull module (e.g. based on Freemarker); ii) the latter (which requires some effort on your side) needs an implementation of the interface `it.ozimov.springboot.templating.mail.service.TemplateService`."_. In other words the observed behavior for your specific code is expected. – Mark Rotteveel Feb 08 '19 at 17:14
  • Thanks Mark. I've read it already but not solved my case. I think I'm gonna use spring-boot-starter-mail because of the project's urgency. – batur Feb 11 '19 at 05:58

0 Answers0