0
測試服務器我測試服務器是否在命令提示符下工作或沒有,所以我用問題而使用telnet
Telnet主機端口
我會收到消息
220 Unauthorized use is prohibited
而光標只是空白
和4-5分鐘後
471 7.7.0 Timeout waiting for client input
connection to the host lost
是否意味着我沒有訪問權限或訪問權限。基本上我試圖通過Java程序從微軟Exchange服務器讀取電子郵件。如果我從java程序調試,我將使用這兩個語句
props.put("mail.smtp.host", "host");
props.put("mail.from", "[email protected]");
它不要求端口或密碼收到以下
Connection refused
錯誤,而我能夠發送郵件。
如果我做這樣
props.setProperty("mail.imap.auth.disable","true");
Store store = session.getStore("imap");
store.connect(host,25,username, password);//password=windows password to login in
調試
EBUG: setDebug: JavaMail version 1.4.3
DEBUG: getProvider() returning
javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
DEBUG: mail.imap.fetchsize: 16384
DEBUG: mail.imap.statuscachetimeout: 1000
DEBUG: mail.imap.appendbuffersize: -1
DEBUG: mail.imap.minidletime: 10
DEBUG: disable AUTH=PLAIN
DEBUG: trying to connect to host "host", port 25, isSSL false
220 Unauthorized use prohibited
javax.mail.MessagingException: 220 Unauthorized use prohibited;
nested exception is:
com.sun.mail.iap.ConnectionException: 220 Unauthorized use prohibited
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:616)
at javax.mail.Service.connect(Service.java:291)
at TestMail.InboxReader.main(InboxReader.java:52)
Caused by: com.sun.mail.iap.ConnectionException: 220 Unauthorized use prohibited
at com.sun.mail.imap.protocol.IMAPProtocol.processGreeting(IMAPProtocol.java:230)
at com.sun.mail.iap.Protocol.<init>(Protocol.java:116)
at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:104)
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:585)
... 2 more
Java Result: 2
這次我更新我的代碼session.getStore(「imap」);和store.connect(主機,25,用戶名,密碼);通過這樣做,我已經收到了例外,因爲「220禁止未經授權使用」並停止了程序。 – vijay 2013-02-14 09:30:29