The problem record ： To write Spring Boot When the project is , It uses thymleaf Templates , However, there is a problem of Chinese garbled code in the e-mail sent .
If in idea It's OK when it's running , But packed into Jar There will be a situation .
How to solve it , because Win The platform defaults to GBK code . So you need to set the following command ,
java -jar jarName.jar
Change to ：（ Can be set to a bat file , Put in jar Package in folder ）
chcp 65001 java -Dfile.encoding=utf-8 -jar demo-0.0.1-SNAPSHOT.jar