|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This class defines a session to an Internet Mail server, and is
the entry point into the Mail API. Use the
SessionFactory
to create a connection to a mail server.
Properties connProps = new Properties(); connProps.setProperty(ISession.CONNPROP_OUTGOING_HOST, "smtp.mycompany.com"); connProps.setProperty(ISession.CONNPROP_INCOMING_HOST, "imap.mycompany.com"); connProps.setProperty(ISession.CONNPROP_PROTOCOL, "imap-smtp"); connProps.setProperty(ISession.CONNPROP_USER, "joe.smith"); connProps.setProperty(ISession.CONNPROP_PASSWORD, "welcome"); connProps.setProperty(ISession.CONNPROP_FROM, "joe.smith@mycompany.com"); ISession s = SessionFactory.getSession(connProps);
SessionFactory
Field Summary | |
static java.lang.String |
CONNPROP_CONNECTION_FACTORY
This is the fully-qualified class name of the database connection factory. |
static java.lang.String |
CONNPROP_DEBUG
This is the debug setting connection property (optional) [default=false, true/false]. |
static java.lang.String |
CONNPROP_FOLDER_DELETED
This is the name of the user's 'Deleted' folder (optional). |
static java.lang.String |
CONNPROP_FOLDER_DRAFTS
This is the name of the user's 'Drafts' folder (optional). |
static java.lang.String |
CONNPROP_FOLDER_SENT
This is the name of the user's 'Sent' folder (optional). |
static java.lang.String |
CONNPROP_FROM
This is the from email address connection property. |
static java.lang.String |
CONNPROP_INCOMING_HOST
This is the incoming host connection property. |
static java.lang.String |
CONNPROP_INCOMING_HOST_PORT
This is the incoming host port connection property (optional). |
static java.lang.String |
CONNPROP_INCOMING_HOST_SSL
This is the incoming host ssl connection property (optional) [default=false, true/false]. |
static java.lang.String |
CONNPROP_ORGANIZATION
This is the name of the user's organization (optional). |
static java.lang.String |
CONNPROP_OUTGOING_HOST
This is the outgoing host connection property. |
static java.lang.String |
CONNPROP_PASSWORD
This is the user's password credential connection property. |
static java.lang.String |
CONNPROP_PROTOCOL
This is the protocol for the store/transport connection properties. |
static java.lang.String |
CONNPROP_USER
This is the user authentication connection property. |
Method Summary | |
void |
close()
Closes the session and frees any remaining resources. |
IFolder |
createFolder(java.lang.String sName)
Creates a with the specified name under the top-level root. |
IMessage |
createMessage()
Creates a new message to prepare for sending. |
boolean |
getDebug()
Gets the debug setting for this session instance. |
IFolder |
getDeletedFolder()
Gets the 'Deleted' folder. |
java.lang.String |
getDeletedFolderName()
Gets the deleted folder name. |
IFolder |
getDraftsFolder()
Gets the 'Drafts' folder. |
java.lang.String |
getDraftsFolderName()
Gets the drafts folder name. |
IFolder |
getFolder(java.lang.Object id)
Gets a folder by the specified ID. |
java.util.List |
getFolders()
Gets the top level folders. |
IFolder |
getInbox()
Gets the 'INBOX' folder. |
java.lang.String |
getInboxFolderName()
Gets the INBOX folder name. |
java.util.Properties |
getProperties()
Gets the properties for this session. |
IFolder |
getSentFolder()
Gets the 'Sent' folder. |
java.lang.String |
getSentFolderName()
Gets the sent folder name. |
void |
refresh()
Refreshes the cached content of this session. |
Field Detail |
public static final java.lang.String CONNPROP_CONNECTION_FACTORY
public static final java.lang.String CONNPROP_INCOMING_HOST
public static final java.lang.String CONNPROP_OUTGOING_HOST
public static final java.lang.String CONNPROP_DEBUG
public static final java.lang.String CONNPROP_PROTOCOL
public static final java.lang.String CONNPROP_FROM
public static final java.lang.String CONNPROP_USER
public static final java.lang.String CONNPROP_PASSWORD
public static final java.lang.String CONNPROP_FOLDER_DELETED
public static final java.lang.String CONNPROP_FOLDER_DRAFTS
public static final java.lang.String CONNPROP_FOLDER_SENT
public static final java.lang.String CONNPROP_ORGANIZATION
public static final java.lang.String CONNPROP_INCOMING_HOST_PORT
public static final java.lang.String CONNPROP_INCOMING_HOST_SSL
Method Detail |
public void refresh() throws MailException
public void close()
public boolean getDebug()
mail.debug
property taken from mail.properties
.true
to print debug; false
otherwisepublic java.util.List getFolders() throws MailException
IFolder
objectspublic IFolder getFolder(java.lang.Object id) throws MailException
id
- the folder ID to retrievenull
if not foundpublic IFolder getInbox() throws MailException
public IFolder getDeletedFolder() throws MailException
public IFolder getDraftsFolder() throws MailException
public IFolder getSentFolder() throws MailException
public java.util.Properties getProperties()
public IFolder createFolder(java.lang.String sName) throws MailException
Hierarchies of folders can be created by entering a name like UserName/Personal/Friends, which will add a new folder called Friends under the directory Personal, which is under the top directory UserName.
sName
- the name of the folder (may not be null
or empty)null
if the create failspublic IMessage createMessage() throws MailException
null
if the create failspublic java.lang.String getDraftsFolderName()
null
, the folder.drafts.name
from mail.properties
is used.public java.lang.String getSentFolderName()
null
, the folder.sent.name
from mail.properties
is used.public java.lang.String getDeletedFolderName()
null
, the folder.deleted.name
from mail.properties
is used.public java.lang.String getInboxFolderName()
|
Compoze Software, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |