How do I send HTML email in Spring MVC?

后端 未结 6 901
[愿得一人]
[愿得一人] 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:58

    You might be interested in checking this article: "Rich HTML email in Spring with Thymeleaf" http://www.thymeleaf.org/doc/articles/springmail.html

    It uses Thymeleaf as a templating view layer, but the concepts and Spring-specific code explained there are common to all Spring applications.

    Besides, it has a companion example application which source code you can use as a base for your needs.

    Regards, Daniel.

提交回复
热议问题