java.lang.Object
javax.mail.Folder
- See Also:
- Top Examples, Source Code
public void addConnectionListener(ConnectionListener l)
- See Also:
ConnectionEvent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void addFolderListener(FolderListener l)
- See Also:
FolderEvent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void addMessageChangedListener(MessageChangedListener l)
- See Also:
MessageChangedEvent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[658]Mail folder listener
By varsha { at } openstream { dot } com on 2004/02/10 01:33:42 Rate
Folder folder = store.getFolder ( "INBOX" ) ;
folder.open ( Folder.READ_WRITE ) ;
folder.addMessageChangedListener ( l ) ;
public void addMessageCountListener(MessageCountListener l)
- See Also:
MessageCountEvent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract void appendMessages(Message[] msgs)
throws MessagingException
- See Also:
- FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract void close(boolean expunge)
throws MessagingException
- See Also:
ConnectionEvent
, IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void copyMessages(Message[] msgs,
Folder folder)
throws MessagingException
- See Also:
appendMessages(javax.mail.Message[])
, IllegalStateException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract boolean create(int type)
throws MessagingException
- See Also:
FolderEvent
, HOLDS_MESSAGES
, HOLDS_FOLDERS
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract boolean delete(boolean recurse)
throws MessagingException
- See Also:
FolderEvent
, IllegalStateException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract boolean exists()
throws MessagingException
- See Also:
create(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract Message[] expunge()
throws MessagingException
- See Also:
MessageCountEvent
, Message.isExpunged()
, IllegalStateException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void fetch(Message[] msgs,
FetchProfile fp)
throws MessagingException
- See Also:
- IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void finalize()
throws Throwable
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected Folder(Store store)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getDeletedMessageCount()
throws MessagingException
- See Also:
- FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract Folder getFolder(String name)
throws MessagingException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract String getFullName()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract Message getMessage(int msgnum)
throws MessagingException
- See Also:
fetch(javax.mail.Message[], javax.mail.FetchProfile)
, getMessageCount()
, IndexOutOfBoundsException, IllegalStateException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract int getMessageCount()
throws MessagingException
- See Also:
- FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Message[] getMessages()
throws MessagingException
- See Also:
fetch(javax.mail.Message[], javax.mail.FetchProfile)
, IllegalStateException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
[874]Download POP3 mails
By Anonymous on 2004/11/03 05:11:51 Rate
String server="Kickjava.com";
String username="user";
String password="password";
//get the default session
Properties props = System.getProperties ( ) ;
Session session = Session.getDefaultInstance (
props ) ;
//get the POP3 message store, and connect to it
Store store = session.getStore ( "pop3" ) ;
store.connect ( server, username, password ) ;
//get the INBOX folder in the default folder
Folder folder = store.getDefaultFolder ( ) ;
folder = folder.getFolder ( "INBOX" ) ;
//download the message and leave it on the server by using read-only
folder.open ( Folder.READ_ONLY ) ;
Message [ ] msgs = folder.getMessages ( ) ;
for ( int msgNum = 0; msgNum < msgs.length;
msgNum++ ) {
// do something with the message
}
folder.close ( false ) ;
store.close ( ) ;
public Message[] getMessages(int start,
int end)
throws MessagingException
- See Also:
fetch(javax.mail.Message[], javax.mail.FetchProfile)
, IndexOutOfBoundsException, IllegalStateException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Message[] getMessages(int[] msgnums)
throws MessagingException
- See Also:
fetch(javax.mail.Message[], javax.mail.FetchProfile)
, IndexOutOfBoundsException, IllegalStateException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getMode()
- See Also:
- IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract String getName()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getNewMessageCount()
throws MessagingException
- See Also:
- FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract Folder getParent()
throws MessagingException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract Flags getPermanentFlags()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract char getSeparator()
throws MessagingException
- See Also:
- FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Store getStore()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract int getType()
throws MessagingException
- See Also:
HOLDS_MESSAGES
, HOLDS_FOLDERS
, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public int getUnreadMessageCount()
throws MessagingException
- See Also:
- FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public URLName getURLName()
throws MessagingException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract boolean hasNewMessages()
throws MessagingException
- See Also:
- FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int HOLDS_FOLDERS
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int HOLDS_MESSAGES
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract boolean isOpen()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public boolean isSubscribed()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Folder[] list()
throws MessagingException
- See Also:
list(java.lang.String)
, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract Folder[] list(String pattern)
throws MessagingException
- See Also:
listSubscribed(java.lang.String)
, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Folder[] listSubscribed()
throws MessagingException
- See Also:
listSubscribed(java.lang.String)
, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Folder[] listSubscribed(String pattern)
throws MessagingException
- See Also:
list(java.lang.String)
, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected int mode
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void notifyConnectionListeners(int type)
- See Also:
ConnectionEvent
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void notifyFolderListeners(int type)
- See Also:
notifyFolderRenamedListeners(javax.mail.Folder)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void notifyFolderRenamedListeners(Folder folder)
- See Also:
notifyFolderListeners(int)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void notifyMessageAddedListeners(Message[] msgs)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void notifyMessageChangedListeners(int type,
Message msg)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected void notifyMessageRemovedListeners(boolean removed,
Message[] msgs)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract void open(int mode)
throws MessagingException
- See Also:
ConnectionEvent
, getType()
, READ_WRITE
, READ_ONLY
, IllegalStateException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int READ_ONLY
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public static final int READ_WRITE
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeConnectionListener(ConnectionListener l)
- See Also:
addConnectionListener(javax.mail.event.ConnectionListener)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeFolderListener(FolderListener l)
- See Also:
addFolderListener(javax.mail.event.FolderListener)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeMessageChangedListener(MessageChangedListener l)
- See Also:
addMessageChangedListener(javax.mail.event.MessageChangedListener)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void removeMessageCountListener(MessageCountListener l)
- See Also:
addMessageCountListener(javax.mail.event.MessageCountListener)
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public abstract boolean renameTo(Folder f)
throws MessagingException
- See Also:
FolderEvent
, IllegalStateException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Message[] search(SearchTerm term)
throws MessagingException
- See Also:
- IllegalStateException, FolderNotFoundException, SearchException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public Message[] search(SearchTerm term,
Message[] msgs)
throws MessagingException
- See Also:
- IllegalStateException, SearchException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setFlags(int start,
int end,
Flags flag,
boolean value)
throws MessagingException
- See Also:
MessageChangedEvent
, Message.setFlags(javax.mail.Flags, boolean)
, IndexOutOfBoundsException, IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setFlags(int[] msgnums,
Flags flag,
boolean value)
throws MessagingException
- See Also:
MessageChangedEvent
, Message.setFlags(javax.mail.Flags, boolean)
, IndexOutOfBoundsException, IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setFlags(Message[] msgs,
Flags flag,
boolean value)
throws MessagingException
- See Also:
MessageChangedEvent
, Message.setFlags(javax.mail.Flags, boolean)
, IllegalStateException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public void setSubscribed(boolean subscribe)
throws MessagingException
- See Also:
- MethodNotSupportedException, FolderNotFoundException
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
protected Store store
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples
public String toString()
- Geek's Notes:
- Description Add your codes or notes Search More Java Examples