[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

java template emailer




I'm trying to create a marketing campaign emailer  for a client that
will let me send out a template JSP file that i will populate with data
from a data source.
For example, I have a TreeSet of data where each index holds personal
information about a user (name, email address, city, etc.)
I want to send out an HTML/JSP email as follows:
 
Hello <%=NAME%>,
 
Thank you for purchasing <%=PRODUCT%>.
Please let us know if you are satisfied with the product:
 
<HERE IS A DROPDOWNLIST>
Very Satisfied
Satisfied
Not Satisfied
You're Awful
<END LIST>
 
<SAVE>
 
Now the problem i'm having is ...I know how to display this information
for each person in the TreeSet (using a forward or include), but
how do i send the completed jsp/html email to that person?
 
 I know that I can do the following:
 
URL thePage = new URL("http://www.yoursite.com/yourjsp.jsp";);
URLConnection conn = thePage.openConnection();
InputStream is = conn.getInputStream();
 
 // read from this InputStream
Then you can direct the data from that InputStream into the e-mail body.
 
But i'm pretty sure this will send out the jsp without having first
compiled it.
I need to figure out a way to either compile the jsp and then send it,
or compile it to some sort of .html file and send it.
I also need to find the most efficient way of doing this since  the
client could be sending large campaigns of emails.
 
Thanks for your time!
 
Chad Smith
"May the road rise to meet you."