我想知道是否有可能通過JavaMail連接到Hotmail?用javamail連接到hotmail?
我已經試過,但它不工作,連接被拒絕......
String host = "pop3.live.com";
String username = "[email protected]";
String password = "rqetqetq";
Session session;
Store store;
String SSL_FACTORY = "javax.net.ssl.SSLSocketFactory";
Properties pop3Props = new Properties();
pop3Props.setProperty("mail.pop3.socketFactory.class", SSL_FACTORY);
pop3Props.setProperty("mail.pop3.socketFactory.fallback", "false");
pop3Props.setProperty("mail.pop3.port", "995");
pop3Props.setProperty("mail.pop3.socketFactory.port", "995");
URLName url = new URLName("pop3", host, 995, "", username, password);
session = Session.getInstance(pop3Props, null);
store = new POP3SSLStore(session, url);
store.connect();
任何人都已經成功做到這一點?
沒有例外,我(剛剛更換電子郵件/密碼)。也許,你應該看看是否有某種防火牆或檢查Hotmail設置。 – 2010-06-18 14:02:03