<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<!-- Generated by javadoc (build 1.6.0_10) on Tue Nov 17 12:13:38 PST 2009 -->
<
META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Session (JavaMail API documentation)
<
META NAME="date" CONTENT="2009-11-17">
<
LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<
SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Session (JavaMail API documentation)";
}
}
<
BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<
A NAME="navbar_top"><!-- --><
/A>
<
A HREF="#skip-navbar_top" title="Skip navigation links"><
/A>
<
TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<
TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<
A NAME="navbar_top_firstrow"><!-- --><
/A>
<
TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<
TR ALIGN="center" VALIGN="top">
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../overview-summary.html"><
FONT CLASS="NavBarFont1"><
B>Overview<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-summary.html"><
FONT CLASS="NavBarFont1"><
B>Package<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <
FONT CLASS="NavBarFont1Rev"><
B>Class<
/B><
/FONT> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="class-use/Session.html"><
FONT CLASS="NavBarFont1"><
B>Use<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-tree.html"><
FONT CLASS="NavBarFont1"><
B>Tree<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../deprecated-list.html"><
FONT CLASS="NavBarFont1"><
B>Deprecated<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../index-files/index-1.html"><
FONT CLASS="NavBarFont1"><
B>Index<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../help-doc.html"><
FONT CLASS="NavBarFont1"><
B>Help<
/B><
/FONT><
/A> <
/TD>
<
TD ALIGN="right" VALIGN="top" ROWSPAN=3><
EM>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../javax/mail/Service.html" title="class in javax.mail"><
B>PREV CLASS<
/B><
/A>
<
A HREF="../../javax/mail/Store.html" title="class in javax.mail"><
B>NEXT CLASS<
/B><
/A><
/FONT><
/TD>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../index.html?javax/mail/Session.html" target="_top"><
B>FRAMES<
/B><
/A>
<
A HREF="Session.html" target="_top"><
B>NO FRAMES<
/B><
/A>
<
SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
<
A HREF="../../allclasses-noframe.html"><
B>All Classes<
/B><
/A>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <
A HREF="#method_summary">METHOD<
/A><
/FONT><
/TD>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <
A HREF="#method_detail">METHOD<
/A><
/FONT><
/TD>
<
A NAME="skip-navbar_top"><
/A>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.
lang.Object<
/A>
<
IMG SRC="../../resources/inherit.gif" ALT="extended by "><
B>javax.mail.Session<
/B>
<
DT><
PRE>public final
class <
B>Session<
/B><
DT>extends <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object<
/A><
/DL>
The Session class represents a mail session and is not subclassed.
It collects together properties and defaults used by the mail API's.
A single default session can be shared by multiple applications on the
desktop. Unshared sessions can also be created. <p>
The Session class provides access to the protocol providers that
implement the <code>Store</code>, <code>Transport</code>, and related
classes. The protocol providers are configured using the following files:
<ul>
<li> <code>javamail.providers</code> and
<code>javamail.default.providers</code> </li>
<li> <code>javamail.address.map</code> and
<code>javamail.default.address.map</code> </li>
</ul>
<p>
Each <code>javamail.</code><i>X</i> resource file is searched for using
three methods in the following order:
<ol>
<li> <code>java.home/lib/javamail.</code><i>X</i> </li>
<li> <code>META-INF/javamail.</code><i>X</i> </li>
<li> <code>META-INF/javamail.default.</code><i>X</i> </li>
</ol>
<p>
The first method allows the user to include their own version of the
resource file by placing it in the <code>lib</code> directory where the
<code>java.home</code> property points. The second method allows an
application that uses the JavaMail APIs to include their own resource
files in their application's or jar file's <code>META-INF</code>
directory. The <code>javamail.default.</code><i>X</i> default files
are part of the JavaMail <code>mail.jar</code> file. <p>
File location depends upon how the <code>ClassLoader</code> method
<code>getResource</code> is implemented. Usually, the
<code>getResource</code> method searches through CLASSPATH until it
finds the requested file and then stops. JDK 1.1 has a limitation that
the number of files of each name that will be found in the CLASSPATH is
limited to one. However, this only affects method two, above; method
one is loaded from a specific location (if allowed by the
SecurityManager) and method three uses a different name to ensure that
the default resource file is always loaded successfully. J2SE 1.2 and
later are not limited to one file of a given name. <p>
The ordering of entries in the resource files matters. If multiple
entries exist, the first entries take precedence over the later
entries. For example, the first IMAP provider found will be set as the
default IMAP implementation until explicitly changed by the
application. The user- or system-supplied resource files augment, they
do not override, the default files included with the JavaMail APIs.
This means that all entries in all files loaded will be available. <p>
<b><code>javamail.providers</code></b> and
<b><code>javamail.default.providers</code></b><p>
These resource files specify the stores and transports that are
available on the system, allowing an application to "discover" what
store and transport implementations are available. The protocol
implementations are listed one per line. The file format defines four
attributes that describe a protocol implementation. Each attribute is
an "="-separated name-value pair with the name in lowercase. Each
name-value pair is semi-colon (";") separated. The following names
are defined. <p>
<table border=1>
<caption>
Attribute Names in Providers Files
</caption>
<tr>
<th>Name</th><th>Description</th>
</tr>
<tr>
<td>protocol</td>
<td>Name assigned to protocol.
For example, <code>smtp</code> for Transport.</td>
</tr>
<tr>
<td>type</td>
<td>Valid entries are <code>store</code> and <code>transport</code>.</td>
</tr>
<tr>
<td>class</td>
<td>Class name that implements this protocol.</td>
</tr>
<tr>
<td>vendor</td>
<td>Optional string identifying the vendor.</td>
</tr>
<tr>
<td>version</td>
<td>Optional string identifying the version.</td>
</tr>
</table><p>
Here's an example of <
code>META-INF
/javamail.default.providers<
/code>
file contents:
protocol=imap; type=store; class=com.sun.mail.imap.IMAPStore; vendor=Sun Microsystems, Inc.;
protocol=smtp; type=transport; class=com.sun.mail.smtp.SMTPTransport; vendor=Sun Microsystems, Inc.;
These resource files map transport address types to the transport
protocol. The <
code>getType<
/code>
method of
<
/code>javax.mail.Address<
/code> returns the address
type. The
<
code>javamail.address.map<
/code> file maps the transport
type to the
protocol. The file format is a series of name-value pairs. Each key
name should correspond to an address type that is currently installed
on the system; there should also be an entry for each
<
code>javax.mail.Address<
/code> implementation that is present if it is
to be used. For example, the
<
code>javax.mail.internet.InternetAddress<
/code>
method
<
code>getType<
/code> returns
"rfc822". Each referenced protocol should
be installed on the system.
For the case of <
code>news<
/code>, below,
the client should install a Transport provider supporting the nntp
Here are the typical contents of a <
code>javamail.address.map<
/code> file:
rfc822=smtp
news=nntp
<!-- ========== METHOD SUMMARY =========== -->
<
A NAME="method_summary"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<
TH ALIGN="left" COLSPAN="2"><
FONT SIZE="+2">
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#addProvider(javax.mail.Provider)">addProvider<
/A><
/B>
(<
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A> provider
)<
/CODE>
Add a provider to the session.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getDebug()">getDebug<
/A><
/B>
()<
/CODE>
Get the debug setting
for this Session.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/PrintStream.html?is-external=true" title="class or interface in java.io">PrintStream<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getDebugOut()">getDebugOut<
/A><
/B>
()<
/CODE>
Returns the stream to be used
for debugging output.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE>static <
A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getDefaultInstance(java.util.Properties)">getDefaultInstance<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A> props
)<
/CODE>
Get the default Session
object.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE>static <
A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getDefaultInstance(java.util.Properties, javax.mail.Authenticator)">getDefaultInstance<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A> props,
<
A HREF="../../javax/mail/Authenticator.html" title="class in javax.mail">Authenticator<
/A> authenticator
)<
/CODE>
Get the default Session
object.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Folder.html" title="class in javax.mail">Folder<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getFolder(javax.mail.URLName)">getFolder<
/A><
/B>
(<
A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName<
/A> url
)<
/CODE>
Get a closed Folder
object for the given URLName.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE>static <
A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getInstance(java.util.Properties)">getInstance<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A> props
)<
/CODE>
Get a new Session
object.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE>static <
A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getInstance(java.util.Properties, javax.mail.Authenticator)">getInstance<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A> props,
<
A HREF="../../javax/mail/Authenticator.html" title="class in javax.mail">Authenticator<
/A> authenticator
)<
/CODE>
Get a new Session
object.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail">PasswordAuthentication<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getPasswordAuthentication(javax.mail.URLName)">getPasswordAuthentication<
/A><
/B>
(<
A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName<
/A> url
)<
/CODE>
Return any saved PasswordAuthentication for this (store or transport)
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getProperties()">getProperties<
/A><
/B>
()<
/CODE>
Returns the Properties
object associated with this Session<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getProperty(java.lang.String)">getProperty<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
name)<
/CODE>
Returns the
value of the specified property.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getProvider(java.lang.String)">getProvider<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> protocol
)<
/CODE>
Returns the default Provider for the protocol
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A>
[]<
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getProviders()">getProviders<
/A><
/B>
()<
/CODE>
This method returns an array of all the implementations installed
via the javamail.[default.]providers files that can
be loaded using the ClassLoader available to this application.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Store.html" title="class in javax.mail">Store<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getStore()">getStore<
/A><
/B>
()<
/CODE>
Get a Store object that implements this user's desired Store
protocol.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Store.html" title="class in javax.mail">Store</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getStore(javax.mail.Provider)">getStore</A></B>(<A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider</A> provider)</CODE>
<BR>
Get an instance of the store specified by Provider.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Store.html" title="class in javax.mail">Store</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getStore(java.lang.String)">getStore</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> protocol)</CODE>
<BR>
Get a Store object that implements the specified protocol.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Store.html" title="class in javax.mail">Store</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getStore(javax.mail.URLName)">getStore</A></B>(<A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A> url)</CODE>
<BR>
Get a Store object for the given URLName.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../javax/mail/Session.html#getTransport()">getTransport</A></B>()</CODE>
<BR>
Get a Transport object that implements this user's desired
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getTransport(javax.mail.Address)">getTransport<
/A><
/B>
(<
A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address<
/A> address
)<
/CODE>
Get a Transport object that can transport a Message of the
specified address
type.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getTransport(javax.mail.Provider)">getTransport<
/A><
/B>
(<
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A> provider
)<
/CODE>
Get an instance of the transport specified in the Provider.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getTransport(java.lang.String)">getTransport<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> protocol
)<
/CODE>
Get a Transport
object that implements the specified protocol.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#getTransport(javax.mail.URLName)">getTransport<
/A><
/B>
(<
A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName<
/A> url
)<
/CODE>
Get a Transport
object for the given URLName.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail">PasswordAuthentication<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#requestPasswordAuthentication(java.net.InetAddress, int, java.lang.String, java.lang.String, java.lang.String)">requestPasswordAuthentication<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html?is-external=true" title="class or interface in java.net">InetAddress<
/A> addr,
int port,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> protocol,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
prompt,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> defaultUserName
)<
/CODE>
Call back to the application to get the needed user
name and password.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#setDebug(boolean)">setDebug<
/A><
/B>
(boolean debug
)<
/CODE>
Set the debug setting
for this Session.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#setDebugOut(java.io.PrintStream)">setDebugOut<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/PrintStream.html?is-external=true" title="class or interface in java.io">PrintStream<
/A> out
)<
/CODE>
Set the stream to be used
for debugging output
for this session.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#setPasswordAuthentication(javax.mail.URLName, javax.mail.PasswordAuthentication)">setPasswordAuthentication<
/A><
/B>
(<
A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName<
/A> url,
<
A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail">PasswordAuthentication<
/A> pw
)<
/CODE>
Save a PasswordAuthentication
for this
(store or transport
) URLName.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#setProtocolForAddress(java.lang.String, java.lang.String)">setProtocolForAddress<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> addresstype,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> protocol
)<
/CODE>
Set the default transport protocol to use for addresses of
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/Session.html#setProvider(javax.mail.Provider)">setProvider<
/A><
/B>
(<
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A> provider
)<
/CODE>
Set the passed Provider to be the default implementation
for the protocol in Provider.protocol overriding any previous values.<
/TD>
<
A NAME="methods_inherited_from_class_java.lang.Object"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<
TH ALIGN="left"><
B>Methods inherited from
class java.
lang.<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object<
/A><
/B><
/TH>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait<
/A>, <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait<
/A><
/CODE><
/TD>
<!-- ============ METHOD DETAIL ========== -->
<
A NAME="method_detail"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<
TH ALIGN="left" COLSPAN="1"><
FONT SIZE="+2">
<
A NAME="getInstance(java.util.Properties, javax.mail.Authenticator)"><!-- --><
/A><
H3>
public static <
A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session<
/A> <
B>getInstance<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A> props,
<
A HREF="../../javax/mail/Authenticator.html" title="class in javax.mail">Authenticator<
/A> authenticator
)<
/PRE>
<
DD>Get a new Session
object.
<
DT><
B>Parameters:<
/B><
DD><
CODE>props<
/CODE> - Properties
object that hold relevant properties.<
br>
It is expected that the client supplies values
for the properties listed in Appendix A of the
JavaMail spec (particularly mail.store.protocol,
mail.transport.protocol, mail.host, mail.user,
and mail.from) as the defaults are unlikely to
work in all cases.<
DD><
CODE>authenticator<
/CODE> - Authenticator
object used to call back to
the application when a user name and password is
needed.
<
DT><
B>Returns:<
/B><
DD>a new Session object<
DT><
B>See Also:<
/B><
DD><
A HREF="../../javax/mail/Authenticator.html" title="class in javax.mail"><
CODE>Authenticator<
/CODE><
/A><
/DL>
<
A NAME="getInstance(java.util.Properties)"><!-- --><
/A><
H3>
public static <
A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session<
/A> <
B>getInstance<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A> props
)<
/PRE>
<
DD>Get a new Session
object.
<
DT><
B>Parameters:<
/B><
DD><
CODE>props<
/CODE> - Properties
object that hold relevant properties.<
br>
It is expected that the client supplies values
for the properties listed in Appendix A of the
JavaMail spec (particularly mail.store.protocol,
mail.transport.protocol, mail.host, mail.user,
and mail.from) as the defaults are unlikely to
work in all cases.
<
DT><
B>Returns:<
/B><
DD>a new Session object<
DT><
B>Since:<
/B><
/DT>
<
A NAME="getDefaultInstance(java.util.Properties, javax.mail.Authenticator)"><!-- --><
/A><
H3>
public static <
A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session<
/A> <
B>getDefaultInstance<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A> props,
<
A HREF="../../javax/mail/Authenticator.html" title="class in javax.mail">Authenticator<
/A> authenticator
)<
/PRE>
<
DD>Get the default Session
object. If a default has not yet been
setup, a new Session object is created and installed as the
Since the default session is potentially available to all
code executing in the same Java virtual machine, and the session
can contain security sensitive information such as user names
and passwords, access to the default session is restricted.
The Authenticator object, which must be created by the caller,
is used indirectly to check access permission. The Authenticator
object passed in when the session is created is compared with
the Authenticator object passed in to subsequent requests to
get the default session. If both objects are the same, or are
from the same ClassLoader, the request is allowed. Otherwise,
Note that if the Authenticator object used to create the session
is null, anyone can get the default session by passing in null. <
p>
Note also that the Properties object is used only the first time
this method is called, when a new Session object is created.
Subsequent calls return the Session object that was created by the
first call, and ignore the passed Properties object. Use the
<
code>getInstance<
/code>
method to get a new Session
object every
time the
method is called. <
p>
In JDK 1.2, additional security Permission objects may be used to
control access to the default session.
<
DT><
B>Parameters:<
/B><
DD><
CODE>props<
/CODE> - Properties
object. Used only if a new Session
It is expected that the client supplies values
for the properties listed in Appendix A of the
JavaMail spec (particularly mail.store.protocol,
mail.transport.protocol, mail.host, mail.user,
and mail.from) as the defaults are unlikely to
work in all cases.<
DD><
CODE>authenticator<
/CODE> - Authenticator
object. Used only if a
new Session object is created. Otherwise,
it must match the Authenticator used to create
the Session.
<
DT><
B>Returns:<
/B><
DD>the default Session object<
/DL>
<
A NAME="getDefaultInstance(java.util.Properties)"><!-- --><
/A><
H3>
public static <
A HREF="../../javax/mail/Session.html" title="class in javax.mail">Session<
/A> <
B>getDefaultInstance<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A> props
)<
/PRE>
<
DD>Get the default Session
object. If a default has not yet been
setup, a new Session object is created and installed as the
Note that a default session created with no Authenticator is
available to all code executing in the same Java virtual
machine, and the session can contain security sensitive
information such as user names and passwords.
<
DT><
B>Parameters:<
/B><
DD><
CODE>props<
/CODE> - Properties
object. Used only if a new Session
It is expected that the client supplies values
for the properties listed in Appendix A of the
JavaMail spec (particularly mail.store.protocol,
mail.transport.protocol, mail.host, mail.user,
and mail.from) as the defaults are unlikely to
work in all cases.
<
DT><
B>Returns:<
/B><
DD>the default Session object<
DT><
B>Since:<
/B><
/DT>
<
A NAME="setDebug(boolean)"><!-- --><
/A><
H3>
public void <
B>setDebug<
/B>
(boolean debug
)<
/PRE>
<
DD>Set the debug setting
for this Session.
Since the debug setting can be turned on only after the Session
has been created, to turn on debugging in the Session
constructor, set the property <
code>mail.debug<
/code> in the
Properties object passed in to the constructor to true. The
value of the <
code>mail.debug<
/code> property is used to
initialize the per-Session debugging flag. Subsequent calls to
the <
code>setDebug<
/code>
method manipulate the per-Session
debugging flag and have no affect on the <
code>mail.debug<
/code>
property.
<
A NAME="getDebug()"><!-- --><
/A><
H3>
public boolean <
B>getDebug<
/B>
()<
/PRE>
<
DD>Get the debug setting
for this Session.
<
DT><
B>Returns:<
/B><
DD>current debug setting<
/DL>
<
A NAME="setDebugOut(java.io.PrintStream)"><!-- --><
/A><
H3>
public void <
B>setDebugOut<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/PrintStream.html?is-external=true" title="class or interface in java.io">PrintStream<
/A> out
)<
/PRE>
<
DD>Set the stream to be used
for debugging output
for this session.
Note that debugging output that occurs before any session is created,
as a result of setting the <
code>mail.debug<
/code> system property,
will always be sent to <
code>System.out<
/code>.
<
DT><
B>Parameters:<
/B><
DD><
CODE>out<
/CODE> - the PrintStream to use
for debugging output<
DT><
B>Since:<
/B><
/DT>
<
A NAME="getDebugOut()"><!-- --><
/A><
H3>
public <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/PrintStream.html?is-external=true" title="class or interface in java.io">PrintStream<
/A> <
B>getDebugOut<
/B>
()<
/PRE>
<
DD>Returns the stream to be used
for debugging output. If no stream
has been set, <
code>System.out<
/code> is returned.
<
DT><
B>Returns:<
/B><
DD>the PrintStream to use
for debugging output<
DT><
B>Since:<
/B><
/DT>
<
A NAME="getProviders()"><!-- --><
/A><
H3>
public <
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A>
[] <
B>getProviders<
/B>
()<
/PRE>
<
DD>This
method returns an array of all the implementations installed
via the javamail.[default.]providers files that can
be loaded using the ClassLoader available to this application.
<
DT><
B>Returns:<
/B><
DD>Array of configured providers<
/DL>
<
A NAME="getProvider(java.lang.String)"><!-- --><
/A><
H3>
public <
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A> <
B>getProvider<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> protocol
)
throws <
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/PRE>
<
DD>Returns the default Provider
for the protocol
specified. Checks mail.<protocol>.class property
first and if it exists, returns the Provider
associated with this implementation. If it doesn't exist,
returns the Provider that appeared first in the
configuration files. If an implementation for the protocol
isn't found, throws NoSuchProviderException
<
DT><
B>Parameters:<
/B><
DD><
CODE>protocol<
/CODE> - Configured protocol
(i.e. smtp, imap, etc
)
<
DT><
B>Returns:<
/B><
DD>Currently configured Provider
for the specified protocol
<
DD><
CODE><
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/CODE> - If a provider
for the given
protocol is not found.<
/DL>
<
A NAME="setProvider(javax.mail.Provider)"><!-- --><
/A><
H3>
public void <
B>setProvider<
/B>
(<
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A> provider
)
throws <
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/PRE>
<
DD>Set the passed Provider to be the default implementation
for the protocol in Provider.protocol overriding any previous values.
<
DT><
B>Parameters:<
/B><
DD><
CODE>provider<
/CODE> - Currently configured Provider which will be
set as the default for the protocol
<
DD><
CODE><
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/CODE> - If the provider passed in
<
A NAME="getStore()"><!-- --><
/A><
H3>
public <
A HREF="../../javax/mail/Store.html" title="class in javax.mail">Store<
/A> <
B>getStore<
/B>
()
throws <
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/PRE>
<
DD>Get a Store
object that implements this user
's desired Store
protocol. The <code>mail.store.protocol</code> property specifies the
desired protocol. If an appropriate Store object is not obtained,
NoSuchProviderException is thrown
<P>
<DD><DL>
<DT><B>Returns:</B><DD>a Store object
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException</A></CODE> - If a provider for the given
protocol is not found.</DL>
</DD>
</DL>
<HR>
<A NAME="getStore(java.lang.String)"><!-- --></A><H3>
getStore</H3>
<PRE>
public <A HREF="../../javax/mail/Store.html" title="class in javax.mail">Store</A> <B>getStore</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> protocol)
throws <A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException</A></PRE>
<DL>
<DD>Get a Store object that implements the specified protocol. If an
appropriate Store object cannot be obtained,
NoSuchProviderException is thrown.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>protocol</CODE> -
<DT><B>Returns:</B><DD>a Store object
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException</A></CODE> - If a provider for the given
protocol is not found.</DL>
</DD>
</DL>
<HR>
<A NAME="getStore(javax.mail.URLName)"><!-- --></A><H3>
getStore</H3>
<PRE>
public <A HREF="../../javax/mail/Store.html" title="class in javax.mail">Store</A> <B>getStore</B>(<A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A> url)
throws <A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException</A></PRE>
<DL>
<DD>Get a Store object for the given URLName. If the requested Store
object cannot be obtained, NoSuchProviderException is thrown.
The "scheme" part of the URL string (Refer RFC 1738) is used
to locate the Store protocol. <p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>url</CODE> - URLName that represents the desired Store
<DT><B>Returns:</B><DD>a closed Store object
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException</A></CODE> - If a provider for the given
URLName is not found.<DT><B>See Also:</B><DD><A HREF="../../javax/mail/Session.html#getFolder(javax.mail.URLName)"><CODE>getFolder(URLName)</CODE></A>,
<A HREF="../../javax/mail/URLName.html" title="class in javax.mail"><CODE>URLName</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getStore(javax.mail.Provider)"><!-- --></A><H3>
getStore</H3>
<PRE>
public <A HREF="../../javax/mail/Store.html" title="class in javax.mail">Store</A> <B>getStore</B>(<A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider</A> provider)
throws <A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException</A></PRE>
<DL>
<DD>Get an instance of the store specified by Provider. Instantiates
the store and returns it.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>provider</CODE> - Store Provider that will be instantiated
<DT><B>Returns:</B><DD>Instantiated Store
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException</A></CODE> - If a provider for the given
Provider is not found.</DL>
</DD>
</DL>
<HR>
<A NAME="getFolder(javax.mail.URLName)"><!-- --></A><H3>
getFolder</H3>
<PRE>
public <A HREF="../../javax/mail/Folder.html" title="class in javax.mail">Folder</A> <B>getFolder</B>(<A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName</A> url)
throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
<DL>
<DD>Get a closed Folder object for the given URLName. If the requested
Folder object cannot be obtained, null is returned. <p>
The "scheme" part of the URL string (Refer RFC 1738) is used
to locate the Store protocol. The rest of the URL string (that is,
the "schemepart", as per RFC 1738) is used by that Store
in a protocol dependent manner to locate and instantiate the
appropriate Folder object. <p>
Note that RFC 1738 also specifies the syntax for the
"schemepart" for IP-based protocols (IMAP4, POP3, etc.).
Providers of IP-based mail Stores should implement that
syntax for referring to Folders. <p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>url</CODE> - URLName that represents the desired folder
<DT><B>Returns:</B><DD>Folder
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException</A></CODE> - If a provider for the given
URLName is not found.
<DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - if the Folder could not be
located or created.<DT><B>See Also:</B><DD><A HREF="../../javax/mail/Session.html#getStore(javax.mail.URLName)"><CODE>getStore(URLName)</CODE></A>,
<A HREF="../../javax/mail/URLName.html" title="class in javax.mail"><CODE>URLName</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getTransport()"><!-- --></A><H3>
getTransport</H3>
<PRE>
public <A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport</A> <B>getTransport</B>()
throws <A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException</A></PRE>
<DL>
<DD>Get a Transport object that implements this user's desired
Transport protcol. The <
code>mail.transport.protocol<
/code> property
specifies the desired protocol. If an appropriate Transport
object cannot be obtained, MessagingException is thrown.
<
DT><
B>Returns:<
/B><
DD>a Transport
object
<
DD><
CODE><
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/CODE> - If the provider is not found.<
/DL>
<
A NAME="getTransport(java.lang.String)"><!-- --><
/A><
H3>
public <
A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport<
/A> <
B>getTransport<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> protocol
)
throws <
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/PRE>
<
DD>Get a Transport
object that implements the specified protocol.
If an appropriate Transport object cannot be obtained, null is
returned.
<
DT><
B>Returns:<
/B><
DD>a Transport
object
<
DD><
CODE><
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/CODE> - If provider
for the given
protocol is not found.<
/DL>
<
A NAME="getTransport(javax.mail.URLName)"><!-- --><
/A><
H3>
public <
A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport<
/A> <
B>getTransport<
/B>
(<
A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName<
/A> url
)
throws <
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/PRE>
<
DD>Get a Transport
object for the given URLName. If the requested
Transport object cannot be obtained, NoSuchProviderException is thrown.
The "scheme" part of the URL string (Refer RFC 1738) is used
to locate the Transport protocol. <
p>
<
DT><
B>Parameters:<
/B><
DD><
CODE>url<
/CODE> - URLName that represents the desired Transport
<
DT><
B>Returns:<
/B><
DD>a closed Transport
object
<
DD><
CODE><
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/CODE> - If a provider
for the given
URLName is not found.<
DT><
B>See Also:<
/B><
DD><
A HREF="../../javax/mail/URLName.html" title="class in javax.mail"><
CODE>URLName<
/CODE><
/A><
/DL>
<
A NAME="getTransport(javax.mail.Provider)"><!-- --><
/A><
H3>
public <
A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport<
/A> <
B>getTransport<
/B>
(<
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A> provider
)
throws <
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/PRE>
<
DD>Get an instance of the transport specified in the Provider. Instantiates
the transport and returns it.
<
DT><
B>Parameters:<
/B><
DD><
CODE>provider<
/CODE> - Transport Provider that will be instantiated
<
DT><
B>Returns:<
/B><
DD>Instantiated Transport
<
DD><
CODE><
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/CODE> - If provider
for the given
provider is not found.<
/DL>
<
A NAME="getTransport(javax.mail.Address)"><!-- --><
/A><
H3>
public <
A HREF="../../javax/mail/Transport.html" title="class in javax.mail">Transport<
/A> <
B>getTransport<
/B>
(<
A HREF="../../javax/mail/Address.html" title="class in javax.mail">Address<
/A> address
)
throws <
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/PRE>
<
DD>Get a Transport
object that can transport a Message of the
specified address type.
<
DT><
B>Returns:<
/B><
DD>A Transport
object
<
DD><
CODE><
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail">NoSuchProviderException<
/A><
/CODE> - If provider
for the
Address
type is not found<
DT><
B>See Also:<
/B><
DD><
A HREF="../../javax/mail/Address.html" title="class in javax.mail"><
CODE>Address<
/CODE><
/A><
/DL>
<
A NAME="setPasswordAuthentication(javax.mail.URLName, javax.mail.PasswordAuthentication)"><!-- --><
/A><
H3>
setPasswordAuthentication<
/H3>
public void <
B>setPasswordAuthentication<
/B>
(<
A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName<
/A> url,
<
A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail">PasswordAuthentication<
/A> pw
)<
/PRE>
<
DD>Save a PasswordAuthentication
for this
(store or transport
) URLName.
If pw is null the entry corresponding to the URLName is removed.
This is normally used only by the store or transport implementations
to allow authentication information to be shared among multiple
uses of a session.
<
A NAME="getPasswordAuthentication(javax.mail.URLName)"><!-- --><
/A><
H3>
getPasswordAuthentication<
/H3>
public <
A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail">PasswordAuthentication<
/A> <
B>getPasswordAuthentication<
/B>
(<
A HREF="../../javax/mail/URLName.html" title="class in javax.mail">URLName<
/A> url
)<
/PRE>
<
DD>Return any saved PasswordAuthentication
for this
(store or transport
)
URLName. Normally used only by store or transport implementations.
<
DT><
B>Returns:<
/B><
DD>the PasswordAuthentication corresponding to the URLName<
/DL>
<
A NAME="requestPasswordAuthentication(java.net.InetAddress, int, java.lang.String, java.lang.String, java.lang.String)"><!-- --><
/A><
H3>
requestPasswordAuthentication<
/H3>
public <
A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail">PasswordAuthentication<
/A> <
B>requestPasswordAuthentication<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/net/InetAddress.html?is-external=true" title="class or interface in java.net">InetAddress<
/A> addr,
int port,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> protocol,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
prompt,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> defaultUserName
)<
/PRE>
<
DD>Call back to the application to get the needed user
name and password.
The application should put up a dialog something like:
Connecting to <protocol> mail service on host <addr>, port <port>.
<prompt>
User Name: <defaultUserName>
Password:
<
DT><
B>Parameters:<
/B><
DD><
CODE>addr<
/CODE> - InetAddress of the host. may be null.<
DD><
CODE>protocol<
/CODE> - protocol
scheme (e.g. imap, pop3, etc.
)<
DD><
CODE>prompt<
/CODE> - any additional String to show as part of
the
prompt; may be null.<
DD><
CODE>defaultUserName<
/CODE> - the default username. may be null.
<
DT><
B>Returns:<
/B><
DD>the authentication which was collected by the authenticator;
<
A NAME="getProperties()"><!-- --><
/A><
H3>
public <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties<
/A> <
B>getProperties<
/B>
()<
/PRE>
<
DD>Returns the Properties
object associated with this Session
<
DT><
B>Returns:<
/B><
DD>Properties object<
/DL>
<
A NAME="getProperty(java.lang.String)"><!-- --><
/A><
H3>
public <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> <
B>getProperty<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
name)<
/PRE>
<
DD>Returns the
value of the specified property. Returns null
if this property does not exist.
<
DT><
B>Returns:<
/B><
DD>String that is the property value<
/DL>
<
A NAME="addProvider(javax.mail.Provider)"><!-- --><
/A><
H3>
public void <
B>addProvider<
/B>
(<
A HREF="../../javax/mail/Provider.html" title="class in javax.mail">Provider<
/A> provider
)<
/PRE>
<
DD>Add a provider to the session.
<
A NAME="setProtocolForAddress(java.lang.String, java.lang.String)"><!-- --><
/A><
H3>
setProtocolForAddress<
/H3>
public void <
B>setProtocolForAddress<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> addresstype,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> protocol
)<
/PRE>
<
DD>Set the default transport protocol to use
for addresses of
the specified type. Normally the default is set by the
<
code>javamail.default.address.map<
/code> or
<
code>javamail.address.map<
/code> files or resources.
<
DT><
B>See Also:<
/B><
DD><
A HREF="../../javax/mail/Session.html#getTransport(javax.mail.Address)"><
CODE>getTransport
(Address
)<
/CODE><
/A><
/DL>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<
A NAME="navbar_bottom"><!-- --><
/A>
<
A HREF="#skip-navbar_bottom" title="Skip navigation links"><
/A>
<
TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<
TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<
A NAME="navbar_bottom_firstrow"><!-- --><
/A>
<
TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<
TR ALIGN="center" VALIGN="top">
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../overview-summary.html"><
FONT CLASS="NavBarFont1"><
B>Overview<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-summary.html"><
FONT CLASS="NavBarFont1"><
B>Package<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <
FONT CLASS="NavBarFont1Rev"><
B>Class<
/B><
/FONT> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="class-use/Session.html"><
FONT CLASS="NavBarFont1"><
B>Use<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-tree.html"><
FONT CLASS="NavBarFont1"><
B>Tree<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../deprecated-list.html"><
FONT CLASS="NavBarFont1"><
B>Deprecated<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../index-files/index-1.html"><
FONT CLASS="NavBarFont1"><
B>Index<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../help-doc.html"><
FONT CLASS="NavBarFont1"><
B>Help<
/B><
/FONT><
/A> <
/TD>
<
TD ALIGN="right" VALIGN="top" ROWSPAN=3><
EM>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../javax/mail/Service.html" title="class in javax.mail"><
B>PREV CLASS<
/B><
/A>
<
A HREF="../../javax/mail/Store.html" title="class in javax.mail"><
B>NEXT CLASS<
/B><
/A><
/FONT><
/TD>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../index.html?javax/mail/Session.html" target="_top"><
B>FRAMES<
/B><
/A>
<
A HREF="Session.html" target="_top"><
B>NO FRAMES<
/B><
/A>
<
SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
<
A HREF="../../allclasses-noframe.html"><
B>All Classes<
/B><
/A>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <
A HREF="#method_summary">METHOD<
/A><
/FONT><
/TD>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <
A HREF="#method_detail">METHOD<
/A><
/FONT><
/TD>
<
A NAME="skip-navbar_bottom"><
/A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
Copyright &#
169;
2009 <
a href="http://www.sun.com">Sun Microsystems, Inc.<
/a>. All Rights Reserved.