Sending email is a common feature required in many business applications. From simple notifications containing plain text to complex reports with links and multiple attachments, email is a common way of asynchronous communication with end users.
This tutorial shows how to send email messages in two different ways:
Using the Apache Commons Email library which offers a simplified API on top of the JavaMail API.
Using Spring Mail Support, a utility library that encapsulates the specifics of the mailing system, also implemented on top of the JavaMail API.
Although email operations include sending, receiving, deleting, setting flags, and others depending on the specific email server in use, this tutorial only discusses email sending through SMTP.