0

We have 2 exchange servers, one is non-production, the other is production, we use java mail to download emails which has .msg attachment we use following code to get email and save

Message[] msgArray = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), true));
...
Message m = msgArray[0];
File tempFile= new File("d:/test/001.eml");
FileOutputStream outStm = new FileOutputStream(tempfile);
m.writeTo(outStm);
......

Connect to non-production exchange server, we can find .msg attachment in 001.eml file, Connect to production exchange server, we can't find .msg attachment in 001.eml file, however attachment can found by using method provided here Download attachments using Java Mail while connect to production exchange server but run get attachment won't be able to work while connect to non-production exchange server.

Anyone can tell me why behavior is different with same code to download same kind of email in 2 different exchange servers, different configurations in exchange server?

Community
  • 1
  • 1
Jackie Dong
  • 813
  • 1
  • 5
  • 20
  • seems connect to non-production exchange server, .msg attachment is regarded as content in JavaMail; however connect produciton exchange server, .msg attachment is regarded as attachment in JavaMail – Jackie Dong May 25 '16 at 08:32
  • What do you mean by "we can't find .msg attachment"? What makes you believe the message has a .msg attachment to begin with? How are you looking for it in the file, just using a text editor? It would help if you provided more detail on what you're doing, including the [JavaMail debug output](http://www.oracle.com/technetwork/java/javamail/faq/index.html#debug) for the two different servers. – Bill Shannon May 25 '16 at 18:25
  • Problem is caused by Mail format which is Rich Text – Jackie Dong May 26 '16 at 02:08
  • Sorry, that's not enough detail for me to be able to help you. – Bill Shannon May 26 '16 at 06:58

0 Answers0