问题描述
- java怎么连接exchange收发邮件
-
public static void main(String[] args) { Exchange.conn(); } public static void conn(){ boolean result = false; ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010); ExchangeCredentials credentials = new WebCredentials(用户名,密码,域); service.setCredentials(credentials); try { service.setUrl(new URI("https://192.168.1.124/EWS/Exchange.asmx")); Folder inbox = Folder.bind(service, WellKnownFolderName.Inbox); System.out.println(service.getTimeout()); } catch (Exception e) { e.printStackTrace(); } }
总是报microsoft.exchange.webservices.data.ServiceLocalException: https://192.168.1.124/EWS/Exchange.asmx : Connection error
浏览器可以打开这个连接,但是需要输入用户密码,还有代码中的用户密码各是指什么?
崩溃中。。。。
解决方案
http://my.oschina.net/u/2291124/blog/525136?p=1
解决方案二:
Java不需要使用Exchange,有JavaMail组件可以用来收邮件。
解决方案三:
exchange 2003配置收发外网邮件的条件
时间: 2024-10-26 05:26:40