<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Wed Jun 25 00:04:05 PDT 2003 -->
<TITLE>
JavaMail API documentation: Package com.sun.mail.smtp
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/sun/mail/pop3/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../../javax/mail/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<H2>
Package com.sun.mail.smtp
</H2>
An SMTP protocol provider for the JavaMail API
that provides access to an SMTP server.
<P>
<B>See: </B>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="#package_description"><B>Description</B></A>
<P>

<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="SMTPMessage.html">SMTPMessage</A></B></TD>
<TD>This class is a specialization of the MimeMessage class that allows
 you to specify various SMTP options and parameters that will be
 used when this message is sent over SMTP.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="SMTPTransport.html">SMTPTransport</A></B></TD>
<TD>This class implements the Transport abstract class using SMTP for
 message submission and transport.</TD>
</TR>
</TABLE>
&nbsp;

<P>
<A NAME="package_description"><!-- --></A><H2>
Package com.sun.mail.smtp Description
</H2>

<P>
An SMTP protocol provider for the JavaMail API
that provides access to an SMTP server.
Refer to <A HREF="http://www.ietf.org/rfc/rfc821.txt">RFC 821</A>
for more information.
<P>
The SMTP provider also supports ESMTP
(<A HREF="http://www.ietf.org/rfc/rfc1651.txt">RFC 1651</A>).
It can optionally use SMTP Authentication 
(<A HREF="http://www.ietf.org/rfc/rfc2554.txt">RFC 2554</A>)
using the LOGIN, PLAIN, and DIGEST-MD5 mechanisms
(<A HREF="http://www.ietf.org/rfc/rfc2592.txt">RFC 2592</A>
and <A HREF="http://www.ietf.org/rfc/rfc2831.txt">RFC 2831</A>).
<P>
To use SMTP authentication you'll need to provide the SMTP Transport
with a username and password when connecting to the SMTP server.  You
can do this using one of the following approaches:
<P>
<UL>
<LI>
Provide an Authenticator object when creating your mail Session
and provide the username and password information during the
Authenticator callback.
<P>
Note that the <code>mail.smtp.user</code> property can be set to provide a
default username for the callback, but the password will still need to be
supplied explicitly.
<P>
This approach allows you to use the static Transport <code>send</code> method
to send messages.
</LI>
<P>
<LI>
Call the Transport <code>connect</code> method explicitly with username and
password arguments.
<P>
This approach requires you to explicitly manage a Transport object
and use the Transport <code>sendMessage</code> method to send the message.
The transport.java demo program demonstrates how to manage a Transport
object.  The following is roughly equivalent to the static
Transport <code>send</code> method, but supplies the needed username and
password:
<P>
<BLOCKQUOTE><PRE>
Transport tr = session.getTransport("smtp");
tr.connect(smtphost, username, password);
msg.saveChanges();	// don't forget this
tr.sendMessage(msg, msg.getAllRecipients());
tr.close();
</PRE></BLOCKQUOTE>
</LI>
</UL>
<P>
You'll also need to supply an appropriate realm when using DIGEST-MD5
authentication; your mail server administrator can supply this information.
You can set this using the <code>mail.smtp.saslrealm</code> property,
or the <code>setSASLRealm</code> method on <code>SMTPTransport</code>.
<P>
SMTP can also optionally request Delivery Status Notifications
(<A HREF="http://www.ietf.org/rfc/rfc1891.txt">RFC 1891</A>).
The delivery status will typically be reported using
a "multipart/report"
(<A HREF="http://www.ietf.org/rfc/rfc1892.txt">RFC 1892</A>)
message type with a "message/delivery-status"
(<A HREF="http://www.ietf.org/rfc/rfc1894.txt">RFC 1894</A>)
part.
JavaMail does not currently provide direct support for these new MIME types,
but you can process them as any other "multipart" or "message" content,
using <code>MimeMultipart</code> and <code>MimeMessage</code> objects.
<P>
See below for the properties to enable these features.
<P>
Note also that <strong>THERE IS NOT SUFFICIENT DOCUMENTATION HERE TO USE THESE
FEATURES!!!</strong>  You will need to read the appropriate RFCs mentioned above
to understand what these features do and how to use them.  Don't just
start setting properties and then complain to us when it doesn't work
like you expect it to work.  <strong>READ THE RFCs FIRST!!!</strong>
<P>
The SMTP protocol provider supports the following properties,
which may be set in the JavaMail <code>Session</code> object.
The properties are always set as strings; the Type column describes
how the string is interpreted.  For example, use
<PRE>
	props.put("mail.smtp.port", "888");
</PRE>
to set the <CODE>mail.smtp.port</CODE> property, which is of type int.
<P>
<TABLE BORDER>
<TR>
<TH>Name</TH>
<TH>Type</TH>
<TH>Description</TH>
</TR>

<TR>
<TD>mail.smtp.user</TD>
<TD>String</TD>
<TD>Default user name for SMTP.</TD>
</TR>

<TR>
<TD>mail.smtp.host</TD>
<TD>String</TD>
<TD>The SMTP server to connect to.</TD>
</TR>

<TR>
<TD>mail.smtp.port</TD>
<TD>int</TD>
<TD>The SMTP server port to connect to, if the connect() method doesn't
explicitly specify one. Defaults to 25.</TD>
</TR>

<TR>
<TD>mail.smtp.connectiontimeout</TD>
<TD>int</TD>
<TD>Socket connection timeout value in milliseconds.
Default is infinite timeout.</TD>
</TR>

<TR>
<TD>mail.smtp.timeout</TD>
<TD>int</TD>
<TD>Socket I/O timeout value in milliseconds.  Default is infinite timeout.</TD>
</TR>

<TR>
<TD>mail.smtp.from</TD>
<TD>String</TD>
<TD>
Email address to use for SMTP MAIL command.  This sets the envelope
return address.  Defaults to msg.getFrom() or
InternetAddress.getLocalAddress().  NOTE: mail.smtp.user was previously
used for this.
</TD>
</TR>

<TR>
<TD>mail.smtp.localhost</TD>
<TD>String</TD>
<TD>
Local host name.  Defaults to
InetAddress.getLocalHost().getHostName().  Should not normally need to
be set if your JDK and your name service are configured properly.
</TD>
</TR>

<TR>
<TD>mail.smtp.ehlo</TD>
<TD>boolean</TD>
<TD>
If false, do not attempt to sign on with the EHLO command.  Defaults to
true.  Normally failure of the EHLO command will fallback to the HELO
command; this property exists only for servers that don't fail EHLO
properly or don't implement EHLO properly.
</TD>
</TR>

<TR>
<TD>mail.smtp.auth</TD>
<TD>boolean</TD>
<TD>If true, attempt to authenticate the user using the AUTH command.
Defaults to false.</TD>
</TR>

<TR>
<TD>mail.smtp.dsn.notify</TD>
<TD>String</TD>
<TD>The NOTIFY option to the RCPT command.  Either NEVER, or some
combination of SUCCESS, FAILURE, and DELAY (separated by commas).</TD>
</TR>

<TR>
<TD>mail.smtp.dsn.ret</TD>
<TD>String</TD>
<TD>The RET option to the MAIL command.  Either FULL or HDRS.</TD>
</TR>

<TR>
<TD>mail.smtp.allow8bitmime</TD>
<TD>boolean</TD>
<TD>
If set to true, and the server supports the 8BITMIME extension, text
parts of messages that use the "quoted-printable" or "base64" encodings
are converted to use "8bit" encoding if they follow the RFC2045 rules
for 8bit text.
</TD>
</TR>

<TR>
<TD>mail.smtp.sendpartial</TD>
<TD>boolean</TD>
<TD>
If set to true, and a message has some valid and some invalid
addresses, send the message anyway, reporting the partial failure with
a SendFailedException.  If set to false (the default), the message is
not sent to any of the recipients if there is an invalid recipient
address.
</TD>
</TR>

<TR>
<TD>mail.smtp.saslrealm</TD>
<TD>String</TD>
<TD>The realm to use with DIGEST-MD5 authentication.</TD>
</TR>

<TR>
<TD>mail.smtp.quitwait</TD>
<TD>boolean</TD>
<TD>
If set to true, causes the transport to wait for the response to the
QUIT command.  If set to false (the default), the QUIT command is sent
and the connection is immediately closed.  (NOTE: The default may change
in the next release.)
</TD>
</TR>

</TABLE>
<P>
In general, applications should not need to use the classes in this
package directly.  Instead, they should use the APIs defined by
<code>javax.mail</code> package (and subpackages).  Applications should
never construct instances of <code>SMTPTransport</code> directly.
Instead, they should use the
<code>Session</code> method <code>getTransport</code> to acquire an
appropriate <code>Transport</code> object.
<P>
<strong>WARNING:</strong> The APIs unique to this package should be
considered <strong>EXPERIMENTAL</strong>.  They may be changed in the
future in ways that are incompatible with applications using the
current APIs.
<P>
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../com/sun/mail/pop3/package-summary.html"><B>PREV PACKAGE</B></A>&nbsp;
&nbsp;<A HREF="../../../../javax/mail/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="package-summary.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>

</BODY>
</HTML>
