How to Know if Your Server Has JavaMail

The JavaMail client contains several libraries you use to send mail from a JSP Web page. To identify if the server has JavaMail and its libraries configured for your JSP application, include it in a test JSP page. If the page sends an error for the file, you don't have JavaMail. If the JSP page executes successfully with the JavaMail include files, your server includes JavaMail.

Instructions

    • 1

      Open the JSP editor from your Windows program menu. Open your current project and create a new file. Name the file "test.jsp" so you can quickly find it and delete it from the project after you finish testing for JavaMail.

    • 2

      Add the JavaMail library to the top of your file. The following shows you how to add an include file with the JavaMail server library:

      <%@ page import="sun.net.smtp.SmtpClient" %>

    • 3

      Save the file and click "Run" in the JSP editor to run the file on the server and in your default browser. If the page returns "Error on Line 1," you know that the server doesn't contain the JavaMail server files. If no error is presented, you know your server contains JavaMail.

Related Searches:

References

Comments

Related Ads

Featured