classpathx-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-discuss] Help needed gnu classpathx mail


From: Chris Burdess
Subject: Re: [Classpathx-discuss] Help needed gnu classpathx mail
Date: Tue, 30 Dec 2003 15:32:49 +0000
User-agent: Mutt/1.3.28i

Chris wrote:
> I can't figure out how to use the mbox mail provider. I'm new to java 
> mail API for reading mail boxes, but it seems to me that a provider 
> should provide a subclass of the "javax.mail.Provider" class, which the 
> gnuclasspathx providers don't seem to do.

no. a provider provides subclasses of the Store and/or Transport
classes. the Provider class is simply a convenience class to tell you
which providers are registered; it shouldn't be subclassed.

> Has anyone got some example code?

how about:

Properties props = System.getProperties();
Session session = Session.getDefaultInstance(props, null);
URLName url = new URLName("mbox:///home/chris/mail");
Store store = session.getStore(url);
Folder root = store.getDefaultFolder();
Folder mymailbox = root.getFolder("mymailbox.mbox");

for further information, read the javamail documentation and the javadoc
for the mbox provider.
-- 
Chris Burdess




reply via email to

[Prev in Thread] Current Thread [Next in Thread]