### Question:
MailService { public void sendHtmlMail(String to, String subject, String content) throws MessagingException { MimeMessage message = javaMailSender.createMimeMessage(); MimeMessageHelper helper = new MimeMessageHelper(message, true); helper.setFrom(from); helper.setTo(to); helper.setSubject(subject); helper.setText(content, true); javaMailSender.send(message); }  void sendTextMail(String to, String subject, String content); void sendHtmlMail(String to, String subject, String content); void sendAttachmentMail(String to, String subject, String content, String[] filePathList); void sendHtmlInlinePhotoMail(String to, String subject, String content, String srcPath, String srcId);  }### Answer:
@Test public void sendHtmlEmailTest() throws MessagingException { String content = "<html>" + "<body>" + "<h1 style=\"" + "color:red;" + "\">hello，这是Spring Boot发送的一封HTML邮件</h1>" + "</body></html>"; mailService.sendHtmlMail(to, "发送HTML邮件", content); }
@Test public void testTemplateEmailTest() throws MessagingException { Context context = new Context(); context.setVariable("username", "张三"); context.setVariable("id", "2667395"); String emailContent = templateEngine.process("emailTemplate", context); mailService.sendHtmlMail(to, "发送模板邮件", emailContent); }