Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax & gmail

 
Brian D Wolf
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20667
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I access Gmail with JavaMail
 
Campbell Ritchie
Sheriff
Pie
Posts: 50248
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a "beginning" question. Moving thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic