In this chapter, we will see how to send an email using a simple test SMTP server and a Gmail SMTP protocol in Java; we will use JavaMail API v1.5.2. It is a very robust solution available in the market.
The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. Generally, implementing a mail session in a compliant Java EE Application server is very simple because Java EE provides all the required classes to create an SMTP client and send messages.
The JavaMail API is also available as an optional package for use with the Java SE platform. The JavaMail 1.5.2 release contains several bug fixes and enhancements. In this chapter, we will cover the following:
- How to configure the mail server in WildFly
- How to send mails in and out of our enterprise components
- How to test the reception of...