Since your action is set to mail.jsp, create this JSP inside JSP too, you can use scripts like
<% // Use Java Mail API to send email here %> Some points 1. Get the information from request e.grequest.getParameter("subject") 2. Explore Java Mail API and find out about SMTP server available for you. If not available then you can also Google SMTP Server (Do bit google on it) 3. I think your problem is how to put Java Code in JSP, so as mentioned above use scriptlets.
The best way to do this is to create a servlet and in your action attribute of the form specify the URL of this servlet. And after sending email from this servlet, you can forward any other JSP or the same one with the message (sent by email).
If you are new to JSP, this should help, but if you are new to Java, tell me that I can send source code that can send email using the parameters of your form.
source share