How do I send HTML email in Spring MVC?

后端 未结 6 927
[愿得一人]
[愿得一人] 2020-12-01 07:21

I have successfully sent simple email using this:

SimpleMailMessage mailMessage = new SimpleMailMessage();

mailMessage.setTo(\"someone@abc.com\");
mailMessa         


        
6条回答
  •  醉酒成梦
    2020-12-01 07:50

    I don't think that SimpleMailMessage class has such options.

    I'm sure that you can do it with JavaMailSender and MimeMessagePreparator, because you need to set MIME content type for HTML.

    See this link for help:

    http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mail.html

提交回复
热议问题