Sending emails is necessary in almost every web application. If your Web application is hosted in WebSphere Application Server you can lookup a Mail session from your servlet or JSP using JNDI. Today I will be explaining how to configure Mail Sessions in WebSphere Application Server? To configure your mail session settings follow the steps.
1. Login to admin console. The admin console url will be http://localhost:9060/admin if you are using the default port and your server is localhost. Else change the port and server name.
2. Click on Resources -> Mail providers.
3. From the page opened click on Built-in Mail Provider.
4. From Built-in Mail Provider page click on ‘Mail Sessions’ link.
5. The Mail Sessions page will be opened. Now click on New.
6. Mail session configuration page appears. Enter the details. Here Name is the administrative name of the JavaMail session object, JNDI name is the name of the resource. If your mail server needs a username and password for sending emails, enter Mail transport user ID and Mail transport password too.
7. Apply and Save the changes to master configuration.
You are done with the configuring your mail session settings. Now you can use the configured the mail session for sending mail from your web application using a JNDI lookup.