4
JavaMail 1.4 api kullanarak bir e-posta hesabının Office365 klasöründeki e-postaları okuyamaya çalışıyorum.IMAP posta sunucusuna erişim 365 with javamail
Benim kodudur:
public static void main(String argv[]) throws Exception {
// Get a Properties object
Properties props = System.getProperties();
// Get a Session object
Session session = Session.getInstance(props, null);
// Get a Store object
Store store = null;
Folder rf = null;
if (CUR_MAIL_PROTOCOL != null)
store = session.getStore("imap");
// Connect
if (CUR_MAIL_HOST != null || CUR_MAIL_LOGIN != null || CUR_MAIL_PWD != null)
store.connect("outlook.office365.com", 993, "**MYEMAIL**", "**MYPASS**");
else
store.connect();
// List namespace
rf = store.getDefaultFolder();
getFolderDetails(rf, true, "");
if ((rf.getType() & Folder.HOLDS_FOLDERS) != 0) {
Folder[] f = rf.list("%");
for (int i = 0; i < f.length; i++)
getFolderDetails(f[i], recursive, " ");
}
store.close();
}
Benim hatadır:
Exception in thread "main" javax.mail.MessagingException: Connection timed out: connect;
nested exception is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:298)
at javax.mail.Service.connect(Service.java:234)
Teşekkür
PS: Hesap Office365
JavaMail SSS [bağlantı sorunların giderilmesi açısından ipuçları] sahiptir (http://www.oracle.com/technetwork/java/javamail/faq/index.html#condebug). –
ok: DEBUG: getprovider() javax.mail.Provider [STORE, IMAP, com.sun.mail.imap.IMAPStore, Sun Microsystems, Inc.] * Tamam Microsoft dönen D Şimdi ben bu hata var Exchange IMAP4 servisi hazır. [QQBNADMAUABSADAANQBDAEEAMAAyADEALgBlAHUAcgBwAHIAZAAwADUALgBwAHIAbwBkAC4AbwB1AHQAbABvAG8AawAuAGMAbwBtAA ==] A0 KABİLİYETİ * KABİLİYETİ ımap4 IMAP4rev1 LOGINDISABLED STARTTLS SASL-IR UIDPLUS HAREKET İD BIRAK ÇOCUK İDLE NAMESPACE LİTERAL + A0 Tamam YETENEĞİ tamamlandı. A1 GİRİŞ [email protected] ***** A1 BAD Komutu Geçersiz durumunda alındı. – Marin
Temel hata şöyledir: LOGIN A1 BAD Komutu Geçersiz durumunda alındı. – Marin