0

I have my program currently set up to output all emails from my gmail account. What I want it to do is print all incoming emails from a microsoft exchange account though. Does anyone know what I should change these properties to?

`properties.put("mail.pop3.host", host);    
properties.put("mail.pop3.port", "995");
properties.put("mail.pop3.starttls.enable", "true");
....
String host = "pop.gmail.com";// change accordingly
String mailStoreType = "pop3";`
mgild
  • 774
  • 6
  • 13
  • you might have some luck with an IMAP client. Here's a question link that looks like it might be helpful, if you go down that path: http://stackoverflow.com/q/5366767/535515 – Gus Jun 24 '14 at 21:16

2 Answers2

0

Unfortunately, I don't think it is as simple as that since Exchange uses its own protocol: EWS. It used to support WebDAV but support for that was removed in 2007.

If this is a personal project, one option is to follow this example; however, if this is a commercial endeavor I would suggest checking out JWebServices for Exchange.

Alex Beardsley
  • 20,988
  • 15
  • 52
  • 67
0

Microsoft's EWS Java API is an option and doesn't cost anything. Examples in C# are pretty easy to translate to Java and they have a short guide on getting started in the package. However, EWS Java only supports the featureset of 2010 SP2 and earlier. I believe you can connect to 2013, but you won't get the new EWS features it offers. It's also unsupported and has some bugs, too, so be ready for that. Still, if your needs are relatively simple, it may fit the bill.

user1017413
  • 2,023
  • 4
  • 26
  • 41