Sending e-mails from any application is an important point because it is through this that many applications send notifications to users or administrators. It is often used to reset passwords and to register new users in almost all the sites or applications. We can thus understand that e-mail is a key service that we have to set up in our application server. Throughout this rest of chapter, we will see how to configure e-mails through the CLI and the management console.
To begin the setup, we need to define the e-mail server that we will use, whether it is internal or external, the sender of e-mails, and the JNDI name. For this example, I will configure a mail session with the following parameters:
Mail session:
java:/mail/TestEmailCLI
JNDI mail session:
java:/mail/TestEmailCLI
Field form:
[email protected]
Other fields such as e-mail, username, and password, if needed, will change according to your settings. For...