Java Mail with Spring by R4R Team


E-mail sending in Java, the JavaMail API is the standard solution. The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications.
Spring framework provides many useful interfaces and classes for sending and receiving mails.

The org.springframework.mail package is the root package that provides mail support in Spring framework.
The central interface for sending emails is the MailSender interface; a simple value object encapsulating the properties of a simple mail such as from and to (plus many others) is the SimpleMailMessage class.

The org.springframework.mail.javamail.JavaMailSender interface adds specialized JavaMail features such as MIME message support to the MailSender interface (from which it inherits). JavaMailSender also provides a callback interface for preparation of JavaMail MIME messages, called org.springframework.mail.javamail.MimeMessagePreparator.

The following additional jars to be on the classpath of your application in order to be able to use the Spring Framework’s email library.

1 The JavaMail mail.jar library
2 The JAF activation.jar library

Leave a Comment:
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!