I am completley new to JSP (my background is in PHP).
I am trying to write a JSP script that will take the values of a html <form> and append them to an email.
For example, here are two sample <form>'s
<form name="test_form_1" id="test_form_1" method="post" action="email_form.jsp">
Full Name: <input type="text" name="full_name" id="full_name" />
Address: <input type="text" name="address" id="address" />
Telephone: <input type="text" name="telephone" id="telephone" />
<form name="test_form_2" id="test_form_2" method="post" action="email_form.jsp">
Appointment Day: <input type="text" name="appointment_day" id="appointment_day" />
Appointment Date: <input type="text" name="appointment_date" id="appointment_date" />
Appointment Time: <input type="text" name="appointment_time" id="appointment_time" />
I would like the email_form.jsp script to handle form elements that are not predetermined. i.e. a script that will iterate through any submitted form elements, apend them to an email, and then send the email.
I would expect the resulting email for the above two processed forms to resemble something like this:
Here is my email_form.jsp script so far
Obviously lots are missing, how do i get all the varibales from a submitted form and make string out of it?
I'd also like to pass the "from" email address as a hidden value in the form.
String to = "";
String subject = "Feedback received from form name: ";
String from = "";
confmessage = "<strong>Thank you, email sent</strong> ";
catch (Exception e)
confmessage = "<strong>Unfortunatly your message could not be sent.</strong>";
Thanks for looking! Your help is much appreciated.