Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem in receiving e-mail (Javamail)

843830Aug 6 2001 — edited Sep 1 2005
Please help I found the error of "no provider for pop3" when I run the following program in my office (using proxy to internet but the pop3 a/c is work for my outlook to rcv e-mail). However, that's no error prompt out when running at home but nothing to display even there are two msgs in my inbox:

static String host = "pop.account.com";
static String username = "myuser";
static String password = "mypwd";

public static void main(String[] args) {

Properties props = new Properties();
Session session = Session.getDefaultInstance(props, null);
session.setDebug(debug);

Store store = session.getStore("pop3");
store.connect(host, username, password);
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
Message message[] = folder.getMessages();
for (int i=0, n=message.length; i<n; i++) {
System.out.println(i + ": " + message.getFrom()[0] + "\t" + message.getSubject());
}

folder.close(false);
store.close();
.
.
.

Thanks in advance!

iSam
xml168@sinatown.com
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2005
Added on Aug 6 2001
17 comments
903 views