我想知道是否可以使用 JavaMail 连接到 Hotmail?
我试过了,但它不起作用,连接被拒绝......
String host = "pop3.live.com";
String username = "laqetqetqet@hotmail.com";
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();
有人已经成功做到这一点了吗?