public class EmailSession extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
password |
protected int |
port |
protected Properties |
properties |
protected String |
protocol |
protected String |
server |
protected String |
username |
| Constructor and Description |
|---|
EmailSession(String server,
int port,
String username,
String password,
String protocol,
Properties properties)
Create a session
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkConnection() |
void |
close() |
void |
closeFolder(javax.mail.Folder folder) |
javax.mail.Message[] |
getMessages(javax.mail.Folder folder) |
String[] |
listFolders() |
javax.mail.Folder |
openFolder(String folderName) |
javax.mail.Message[] |
search(javax.mail.Folder folder,
javax.mail.search.SearchTerm searchTerm) |
protected final String server
protected final int port
protected final String username
protected final String password
protected final String protocol
protected final Properties properties
public EmailSession(String server, int port, String username, String password, String protocol, Properties properties) throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic String[] listFolders() throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic void checkConnection()
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic javax.mail.Folder openFolder(String folderName) throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic void closeFolder(javax.mail.Folder folder)
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic javax.mail.Message[] getMessages(javax.mail.Folder folder)
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic javax.mail.Message[] search(javax.mail.Folder folder,
javax.mail.search.SearchTerm searchTerm)
throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic void close()
throws javax.mail.MessagingException
javax.mail.MessagingException