I want to send email with zip file attachment.. I m able to send pdf files without saving them on physical location using ByteArrayOutputStream. But when I try zip those file an
You forgot to call zos.closeEntry() after each item is written, at the end of your for loop. And as noted, you haven't closed your ZipOutputStream.
I don't think you need to call entry.setSize(), either.
Otherwise, this should work.