jQuery in Action, 3rd edition
The moose likes Other JSE/JEE APIs and the fly likes can we use java mail to send email having dynamic data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "can we use java mail to send email having dynamic data" Watch "can we use java mail to send email having dynamic data" New topic

can we use java mail to send email having dynamic data

Gols Tan

Joined: Aug 09, 2005
Posts: 7
i am thinking to make one report generator on client side that take some online test and then represent report of some data in bar graph which is made using jsp page and shown through html in browser.
Now i wanted to send this information to server side

will java mail be helpful in making some program that can send such stuff to server ?
if yes, then in what form ...as on client it can be displayed dynamically using jsp and html... what about server side

My idea is to send the required data through email having represention of that data of client side
like send email with html on it and let it shwown on html enabled email application ( i think all email application show html stuff) like when we subscribe the email we got html email automatically but

what if my client application is in differnet locations and send email rarely ..is it possible that they can use Java Mail and use Google email (becasue google provide free smtp and pop) and send email through it

other option is to update the database....
but is it possible that application on client side can update the database on the server side ? how ? what process to be followed ?
the data will be save in xml format on client side !!!
i will parse the xml and update the database.... will there be any security issue ?
please help me to solve this issue of transering data either through email or update the database !!
[ December 03, 2005: Message edited by: Gols Tan ]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
I don't quite understand the flow of data in your application, but if the page displaying the data is a JSP page, then the data is on the server already, because that's where a JSP gets executed. The JSP (or better a servlet) should be able to store the data in a database. I guess I'm mising something.

By the way, I wouldn't assume everyone can read HTML email - many people dislike it enough to turn it off.
Gols Tan

Joined: Aug 09, 2005
Posts: 7
i mean to say..when my application on client side takes the test of candidate...i want that test result should be emailed in html type to particular person....how this can be done...

on the client side ( a consultant where job-applicant gives his test for co.) the result of the candidate is stored in xml form !!!

I have the two options to send the result of the candidate to company for which test is taken...

1. the result is read from xml using jdom/sax parser and uploaded directly to database of company ...where company application can fetch the database uploaded and present the result of candidate in usefull manner ( bar graph) etc..

But in above 1. point will there be risk/security issue of the discoure of database.. I think in that case i have to put the uri of database in class file not in properties file ... (is I am right ?)
pls comment on this.

2. The second options is to send the email in html form from the client side ( where cadidate gives his test) in a good presentable form... using smtp of gmail ( as gmail provides free smtp/pop a/c)
In that case email will be having all bar chart created dynamically using data stored in xml file... and send as email..
so is I can send the email using java mail in this case ???
But in this case... Is it possible to maintain the state of dynamic data..when the email has reached its destination... i think it will ?
becasue email generated dynamically then it becomes static html page which will be emailed ???
is i am right ?

what do u say... gusys....

please tell me is above technicalll thing is possible.. !!! ??

and what is better and what difficulties I can face...

pls contribute ur valuable suggesion
if any further details is required i will tell u

FYI .. tomcat/jdk will be installed first on client side which will run the test...

Thanks and Regards
[ December 04, 2005: Message edited by: Gols Tan ]
I agree. Here's the link: http://aspose.com/file-tools
subject: can we use java mail to send email having dynamic data
It's not a secret anymore!