title: I have my own code to create a excel file and I want to send that as an attachment to email without saving file in local system
body: <p>I am working on a case where I will be supplied with data and I will create a excel file using that data.</p>
  
  <p>Right now I am creating it in my local system and later adding that as an attachment and sending through email using Java Mail Service.</p>
  
  <p>But I dont want to store excel file in my local system and I want to just pass the stream object to email service and send email. So that there wont be any local storage of file still able to send attachment.</p>
  
  <p>Please reply if there is any solution ?</p>
  
  <p>// Created WorkBook
  HSSFWorkbook workbook = new HSSFWorkbook();</p>
  
  <p>FileOutputStream outputStream = new FileOutputStream(FILE_NAME)) workbook.write(outputStream);</p>
  
  <p>here FILE_NAME is fully qualified system path where I will be storing file.</p>
  
  <p>I want to skip this and directly send attachment </p>