Let's see the simple code to send mime message with attachment(image). Following are the annotations used in the Spring framework: @Component – The @Component stereotype annotation is used to indicate a class as “Component” so that Spring can auto-scan the classes for dependency injection. All rights reserved. Spring Boot; JUnit 5; Maven; Misc; Java Custom Annotations Example. Once you got JavaMailSender ready, only thing left is to prepare the actual message itself and then send it using JavaMailSender. Feel free to comment, and suggest improvements. chandrashekhar 2019-04-20T15:48:57+05:30 January 1st, 2018 | Spring Boot | In this … 3. In our example we will understand how to use it to send email… Below is an example of the file content. Example of Sending mail in Spring by Gmail Server . Spring 4.3 provides a new @RequestAttribute annotation that helps us access to pre-existing global request attributes (outside the controller). Developed by JavaTpoint.