File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes send a jsp page on to email Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "send a jsp page on to email" Watch "send a jsp page on to email" New topic

send a jsp page on to email

Ali Khalfan
Ranch Hand

Joined: Nov 03, 2007
Posts: 126

I've displayed some output on a jsp page that i want to send as an email. I think it's more logical to send the jsp page by email rather then send it in a servlet because it's relted to the view side.

I've tried to fiddle around the apache mailer tag without success (tied to do the following)

this just displays an empy page and it seems no action is taken (no error in the logs either)

what works for me is sending an email in a servlet...but i have a problem there beause i don't want to print the jsp output in a servlet (looks real ugly) and i still believe this should be done feom a jsp page

ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
Check weather taglib is configured properly in web.xml

check for below lines.


also, reckon that email smtp server is configured, you need a mail server, or use GMAIL SMTP to send email.


Ujjwal B Soni <baroda, gujarat, india> <+918866008962>
"Helping hands are better than praying lips......"
Vikas Kapoor
Ranch Hand

Joined: Aug 16, 2007
Posts: 1374
Do you mean you want to pass some information to user through Email?. Use Activation link, New Offers for example.
I don't have any idea about apache mailer but you can try Java Mail API and see how you can include HTML and attachments.
Ali Khalfan
Ranch Hand

Joined: Nov 03, 2007
Posts: 126

I am already using java mail (in a servlet) and it works fine....but look at the way i'm generating the output

This is not the best way to generate an output and its a violation of the MVC architecture, but currently i have no choice.

ujjwal ,

I already have the taglibs included in the web.xml file, and as your can i have included google's smtp server (trhough port 465), but it doesn't work right......

I agree. Here's the link:
subject: send a jsp page on to email
It's not a secret anymore!