使用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();
有人已经成功做到了这一点吗?
I wonder if it is possible to connect to Hotmail with JavaMail?
I've tried this but it doesn't work, connection refused...
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();
Anyone already succeeded to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Hotmail 现在支持 pop3(通过 SSL)。
因此,您需要进行以下设置:
对于所有其他属性,您必须在属性字符串中添加“s”(因此它显示“pop3s”而不是“pop3”):
对我来说,以下代码效果很好:
Hotmail now supports pop3 (through SSL).
Thus, you need the following settings:
For all other properties, you must add a "s" in the properties string (so it says "pop3s" instead of "pop3"):
For me, the following code works nicely:
您可以尝试这个 SourceForge 项目
MrPostman 是来自本地 POP 客户端(如 Microsoft Outlook、Mozilla 邮件)的电子邮件网关客户端等不同的网络邮件服务,如雅虎和Hotmail。它的设计是为了可扩展性,因此很容易向其中添加更多网络邮件服务。
You could try this SourceForge project
MrPostman is an email gateway from local POP clients like Microsoft Outlook, Mozilla's mail client etc. to different web mail services like Yahoo and Hotmail.It is being designed for extensibility so is easy to add more web mail services to it.