wood burning stoves 2.0*
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to use JSP to send email" Watch "How to use JSP to send email" New topic
Author

How to use JSP to send email

Seagle Yang
Greenhorn

Joined: Dec 17, 2002
Posts: 2
Hi,all
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.
Seagle
Riley Brook
Greenhorn

Joined: Oct 24, 2002
Posts: 5
hmmm..
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: 1871
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?
thanks!
maulin
Geeta Gune
Greenhorn

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
Geeta
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use JSP to send email