Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Email zip attachments

 
Shreya Kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 java.util.zip package for zipping.
 
vivien siu
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic