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

How to use JSP to send email

Seagle Yang

Joined: Dec 17, 2002
Posts: 2
Can anybody help me?
I want to put a button on the JSP page, when click it, we can open up the default email application (e.g. Outlook) and automatically attach a specific file to it, and then we can manually input the receiver and some content to send the email to somebody.
I don't know it is possible, if can, what should I do? Any response will be much appreciated.
Riley Brook

Joined: Oct 24, 2002
Posts: 5
If this is an intranet app and you can guarantee all users have Outlook: is there a file extension which is recognized as an Outlook file? Maybe by constructing this file on-the-fly and shooting it to the browser it will launch outlook with the content you prefilled it with. This is an idea. I've never tried this in practice.
Other option would be to do the email construction (and sending) all on the app server. Provide a message box for the user's data entry (reply address, comments, attached files, etc.) and then use JavaMail to send it maybe ccing the originator so it gets back to the client's Outlook.
Please post what you do end up doing. I'll be curious.
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
hi Seagle,
so you want to attach a file on the server side to the email you pop up? OR client side file as an attachment?
Geeta Gune

Joined: Mar 19, 2002
Posts: 17
Hi yang,
Actually u can open the outlook express and put the subject and sent to address simply by using the mailto tag which u can use in the href tag on a link or a button.

But sending an attachment as well is a little bit difficult though but i would recommend that u check out some javascript forums..
We are not using jsp at all if u want to send mail through outlook express but if u want to use the javamail package then maybe u should check out the sun site for javamail docs and examples.
Hope this helps
I agree. Here's the link:
subject: How to use JSP to send email
It's not a secret anymore!