Java Mail API with Spring:-
There are several interfaces and classes for java mail support in spring framework are as follows:
1 MailSender interface: This is the root interface. It provides basic functionality for sending simple mails.
2 JavaMailSender interface: This is the subinterface of MailSender. It supports MIME messages. It is mostly used with MimeMessageHelper class for the creation of JavaMail MimeMessage, with attachment etc. The spring framework recommends MimeMessagePreparator mechanism for using this interface.
3 JavaMailSenderImpl class: That provides the implementation of JavaMailSender interface. It supports JavaMail MimeMessages and Spring SimpleMailMessages.
4 SimpleMailMessage class: This is used to create a simple mail message including from, to, cc, subject and text messages.
5 MimeMessagePreparator interface: This is the callback interface for the preparation of JavaMail MIME messages.
6 MimeMessageHelper class: This is the helper class for
creating a MIME message. It offers support for inline elements such as
images, typical mail attachments and HTML text content etc.