wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes javax & gmail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "javax & gmail" Watch "javax & gmail" New topic
Author

javax & gmail

Brian D Wolf
Greenhorn

Joined: Dec 06, 2009
Posts: 2
Hi,

I am trying to download my gmail using JavaMail .I have pop enabled on gmail account.

for "abc@gmail.com", and also tried various permutations of "pop" and "pop3" and "imap"


I use these settings in my Mozilla Thunderbird client


String popServer="pop.gmail.com";
String popUser="abc";
String popPassword="xxxx";

Properties props = System.getProperties();
Session session = Session.getDefaultInstance(props, null);
store = session.getStore("pop3");
store.connect(popServer, popUser, popPassword);

i get
=========================================
nested exception is:
java.net.SocketException: Connection reset
at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:148)
at javax.mail.Service.connect(Service.java:275)


thanks
Brian
Brian D Wolf
Greenhorn

Joined: Dec 06, 2009
Posts: 2
I'm replying to my own post here. I guess I'm guilty of the lmgtfy syndrome.
I'm not sure if this belongs in a beginner forum either.

Apparently doodlw only supports pop3 through ssl, so onew way is through port 995.




pop3Props.setProperty("mail.pop3.port", "995");
pop3Props.setProperty("mail.pop3.socketFactory.port", "995");

URLName url = new URLName("pop3", "pop.gmail.com", 995, "",
username, password);

session = Session.getInstance(pop3Props, null);
store = new POP3SSLStore(session, url);
store.connect();
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19653
    
  18

How do I access Gmail with JavaMail


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38007
    
  22
Not a "beginning" question. Moving thread.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javax & gmail
 
Similar Threads
Matching mail message with UUID
connecting to gmail pop3 server
How to retrieve mails from POP 3 server
POP3 JavaMail Client-How to Read Unread Mails only
Reading Java Mail