An example Spring-boot project using Java Mail, Apache Velocity, and HTML template to generate a beautiful templated email. The project serves as a quick boilerplate to be used in other larger projects. Any contribution is welcome by opening a pull request. The example configures the mailer to send email over Gmail's SMTP protocol. Users will need to authorize "less secure app" on the security setting of their google account.
The HTML Template in this example is based from this.
- This is a simple maven project you can import directly to your Java IDE of choice.
- To run an example,
- Change mailing recipient in
application.properties
- Update sender credentials over on
com.as12.config.EmailConfig
- For Gmail, Google now requires 2 factor-authentication and App password. See https://support.google.com/accounts/answer/185833
- Run your application once the properties are configured
- Navigate to
http://localhost:8080/test
to send an example email
- Change mailing recipient in