Firstly thanks for your reply.. Well below is the code iam using ..
MsgParser msgp = new MsgParser();
Message msg = msgp.parseMsg("c://Testingmail.msg");//some msg file which i have taken from outlook and kept in local disk
String str1=msg.toString();
b=str1.getBytes();// here b is byte array
//The below code is to open show the pop up so that user can save the msg file..
response.setContentType("application/vnd.ms-outlook"+" ;charset=utf-8");
response.setHeader("Content-Disposition",
"attachment;filename=" + "Testingmail.msg");
ServletOutputStream servletOutputStream = response
.getOutputStream();
DataOutput dataOutput = new DataOutputStream(
servletOutputStream);
if (b!= null) {
response.setContentLength(b.length);
for (int i = 0; i < b.length; i++) {
dataOutput.writeByte(b[i]);
}
}
if (servletOutputStream != null) {
servletOutputStream.flush();
servletOutputStream.close();
}
I tried with many combinations while reading the msg file from server path like using bufferreader ... once i save the file , iam getting in msg format but not actual content .. when i say open directly , it is saying error cannot open file or you dont have permission ...... if i drag that downloaded file it is going as attachment of new mail..one thing is for sure.. iam not getting actual content of server file..i think once we say save from outlook it will be stored as encoded file.. we need to decode it..i tried by decoding the file also but invain if you have code to get it please share ...