Now, let's take a look at MailManager and its dependencies. DefaultMailManager, the implementation of MailManager, will need to create the message body based on the template and then use the mail service API to send the message. The following figure shows the relationship between MailManager and its dependencies:
Figure 10.17: MailManager and its dependencies
As you can see, DefaultMailManager uses FreeMarkerTemplateUtils to create a message body from the template and uses Mailer, the mail service API, to send the message. The implementation of the Mailer interface is AsyncMailer, which will use Spring's JavaMailSender to send out a message.