dcsimg
How do I create an email message body by reading a document template and dynamically populating data in between the document?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Bhaskar_Mulpuri
Posted On:   Tuesday, April 23, 2002 08:13 AM

I am writing a Servlet based program that has to send emails to registered users. I will have a document template with embeded blanks in between for the user name, link and other details that will be dynamically populated when the mail is created. (This is something similar to the Mail Merge utility in the Windows platform.)

How do I go about reading a document template and filling the blanks in between to populate the data dynamically. How do I do this in Java? I would appreciate it if u could provide some links to relevant information.

Thanks in advance,
Bhaskar

Re: How do I create an email message body by reading a document template and dynamically populating data in between the document?

Posted By:   Bhaskar_Mulpuri  
Posted On:   Thursday, April 25, 2002 09:41 AM

I was able to figure this out. For those of u who are interested:

I am using a jsp page as the email message body. From my java program, I build a URL connection to the JSP page.
I send a serializable object thru the connection object's OutputStream and in the jsp page I get the object thru the request object's InputStream. This object will have the dynamic content.

The connection object's inputstream will give me the output of the jsp page, which is html.

I then use JavaMail to send this html info.

But I would like to hear if there are any better alternative solutions.
About | Sitemap | Contact