permaculture playing cards
The moose likes Servlets and the fly likes sending attachments using javamail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "sending attachments using javamail" Watch "sending attachments using javamail" New topic

sending attachments using javamail

Sree Jag
Ranch Hand

Joined: Oct 14, 2003
Posts: 77
Hi all,

I am writing an email application with attachments. i realise that we should store the file that is selected by the client on the client machine in a temporary directory on the server that is running the email application.

can somebody please tell me how to store the file on the server temporarily and delete it after sending the mail?

Thanks in advance,

Sree Jag<br />SCJP 1.4
Vijay Vaddem
Ranch Hand

Joined: Feb 13, 2004
Posts: 243

Hope this will be helpful.....



[ July 12, 2004: Message edited by: Vijay Vaddem ]
Rovas Kram
Ranch Hand

Joined: Aug 08, 2003
Posts: 135
You don't really have to save the mime part to a file. You can write a buffered data source simply by extending the javax.activation.DataSource class.

For example

jQuery in Action, 3rd edition
subject: sending attachments using javamail
It's not a secret anymore!