It's not a secret anymore!
The moose likes Other JSE/JEE APIs and the fly likes Email zip attachments 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 "Email zip attachments" Watch "Email zip attachments" New topic

Email zip attachments

Shreya Kumar

Joined: Dec 16, 2005
Posts: 3
I have a requirement to send emails with zip attachments. I have to extract the data from the database, zip it and then email it. The problem is that I'm trying to do this without actually writing a zip file on the local system. If I attach it as a zip file I have no problem. I've searched high and low for examples but not found any. Is there any technical limitation that precludes this solution? Any ideas , anyone?
I'm using the Java Mail Api for emailing and the package for zipping.
vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
To attach the zip file, you will need to provide the file path (to your physical zip file) to the javamail. If you don't have physical file then how can you even attach it?

but then if you don't want the zip file after emailing, you can always call a method to delete the zip file on your local machine.

I'm not available, my BF's name is WORK.
I agree. Here's the link:
subject: Email zip attachments
It's not a secret anymore!