views:

89

answers:

2

Hello

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?

A: 

Hotmail hasn't SMTP nor POP (Maybe you can guess who developed it). That is also the reason why you have to use a lot of tricky plugins for Thunderbird to access your hotmail-mail.

The plugins that Thunderbird uses does following:

  1. Run a SMTP- and POP-Server by himself.
  2. Set Thunderbird email settings to localhost.
  3. The plugin will handle the requests and will connect with a custom way to Hotmail servers. It will download / send mails.
  4. Communicate with Thunderbird through the server he is running (port 25 and the other one...)
Martijn Courteaux
ok but how gmail does? actually i've configured my gmail account to retrieve the hotmail content to my gmail account...it works and i use pop3.live.com (as POP server) with port 995.What are these thunderbird plugins?
Sebastien Lorber
Actually, Hotmail has been supporting POP since spring 2009, and it has an authenticated SMTP server at smtp.live.com.
gregcase
+1  A: 

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.

Romain Hippeau