Book Image

Mastering Spring Application Development

By : Anjana Mankale
Book Image

Mastering Spring Application Development

By: Anjana Mankale

Overview of this book

Table of Contents (19 chapters)
Mastering Spring Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Interfaces and classes used for sending mails with Spring


The package org.springframework.mail is used for mail configuration in the spring application.

The following are the three main interfaces that are used for sending mail:

  • MailSender: This interface is used to send simple mail messages.

  • JavaMailSender: This interface is a subinterface of the MailSender interface and supports sending mail messages.

  • MimeMessagePreparator: This interface is a callback interface that supports the JavaMailSender interface in the preparation of mail messages.

The following classes are used for sending mails using Spring:

  • SimpleMailMessage: This is a class which has properties such as to, from, cc, bcc, sentDate, and many others. The SimpleMailMessage interface sends mail with MailSenderImp classes.

  • JavaMailSenderImpl: This class is an implementation class of the JavaMailSender interface.

  • MimeMessageHelper: This class helps with preparing MIME messages.