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

Re: java template emailer



Since I caused such a ruckous yesterday, I'll try and
be more productive today :-)

Chad,
Your thought of getting the InputStream of the URL is
the thing to do. It will get the compiled/dynamic page,
not the uncompiled JSP. Something like this would work:

InputStream is = new
URL("http://yourURLhere";).openStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader reader = new BufferedReader(isr);
StringBuffer body = new StringBuffer();
String line = null;
while ((line = reader.readLine()) != null)

    body.append(line);
    body.append(System.getProperty("line.separator"));





This may definately be a resource hog if it used for
mass mailings. But it is extremely affective way of
doing dynamicly generated emails for something like a
notification system.

Matthew Hardin
matthew@hardin.net