mimemessage.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 1,271 行 · 第 1/5 页

HTML
1,271
字号
<!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 Thu Jan 17 03:51:35 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Class  MimeMessage
</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="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&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-all.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="../../../javax/mail/internet/MimeBodyPart.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html"><B>NEXT CLASS</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="MimeMessage.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;<A HREF="#inner_class_summary">INNER</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.mail.internet</FONT>
<BR>
Class  MimeMessage</H2>
<PRE>
java.lang.Object
  |
  +--<A HREF="../../../javax/mail/Message.html">javax.mail.Message</A>
        |
        +--<B>javax.mail.internet.MimeMessage</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A>, <A HREF="../../../javax/mail/Part.html">Part</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>MimeMessage</B><DT>extends <A HREF="../../../javax/mail/Message.html">Message</A><DT>implements <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></DL>

<P>
This class represents a MIME style email message. It implements
 the <code>Message</code> abstract class and the <code>MimePart</code>
 interface. <p>

 Clients wanting to create new MIME style messages will instantiate
 an empty MimeMessage object and then fill it with appropriate 
 attributes and content. <p>
 
 Service providers that implement MIME compliant backend stores may
 want to subclass MimeMessage and override certain methods to provide
 specific implementations. The simplest case is probably a provider
 that generates a MIME style input stream and leaves the parsing of
 the stream to this class. <p>

 MimeMessage uses the <code>InternetHeaders</code> class to parse and
 store the toplevel RFC 822 headers of a message. <p>

 <hr><strong>A note on RFC 822 and MIME headers</strong><p>

 RFC 822 header fields <strong>must</strong> contain only 
 US-ASCII characters. MIME allows non ASCII characters to be present
 in certain portions of certain headers, by encoding those characters.
 RFC 2047 specifies the rules for doing this. The MimeUtility
 class provided in this package can be used to to achieve this.
 Callers of the <code>setHeader</code>, <code>addHeader</code>, and
 <code>addHeaderLine</code> methods are responsible for enforcing
 the MIME requirements for the specified headers.  In addition, these
 header fields must be folded (wrapped) before being sent if they
 exceed the line length limitation for the transport (1000 bytes for
 SMTP).  Received headers may have been folded.  The application is
 responsible for folding and unfolding headers as appropriate. <p>
<P>
<DL>
<DT><B>See Also: </B><DD><A HREF="../../../javax/mail/internet/MimeUtility.html"><CODE>MimeUtility</CODE></A>, 
<A HREF="../../../javax/mail/Part.html"><CODE>Part</CODE></A>, 
<A HREF="../../../javax/mail/Message.html"><CODE>Message</CODE></A>, 
<A HREF="../../../javax/mail/internet/MimePart.html"><CODE>MimePart</CODE></A></DL>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->

<A NAME="inner_class_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Inner Class Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html">MimeMessage.RecipientType</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This inner class extends the javax.mail.Message.RecipientType
 class to add additional RecipientTypes.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="inner_classes_inherited_from_class_javax.mail.Message"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Inner classes inherited from class javax.mail.<A HREF="../../../javax/mail/Message.html">Message</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/mail/Message.RecipientType.html">Message.RecipientType</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#content">content</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Byte array that holds the bytes of this Message's content.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.io.InputStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#contentStream">contentStream</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If the data for this message was supplied by an
 InputStream that implements the SharedInputStream interface,
 <code>contentStream</code> is another such stream representing
 the content of this message.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../javax/activation/DataHandler.html">DataHandler</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#dh">dh</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The DataHandler object representing this Message's content.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../javax/mail/Flags.html">Flags</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#flags">flags</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The Flags for this message.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../javax/mail/internet/InternetHeaders.html">InternetHeaders</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#headers">headers</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The InternetHeaders object that stores the header
 of this message.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#modified">modified</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A flag indicating whether the message has been modified.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#saved">saved</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Does the <code>saveChanges</code> method need to be called on
 this message?  This flag is set to false by the public constructor
 and set to true by the <code>saveChanges</code> method.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_javax.mail.Message"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class javax.mail.<A HREF="../../../javax/mail/Message.html">Message</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/mail/Message.html#expunged">expunged</A>, <A HREF="../../../javax/mail/Message.html#folder">folder</A>, <A HREF="../../../javax/mail/Message.html#msgnum">msgnum</A>, <A HREF="../../../javax/mail/Message.html#session">session</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_javax.mail.Part"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from interface javax.mail.<A HREF="../../../javax/mail/Part.html">Part</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/mail/Part.html#ATTACHMENT">ATTACHMENT</A>, <A HREF="../../../javax/mail/Part.html#INLINE">INLINE</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#MimeMessage(javax.mail.Folder, java.io.InputStream, int)">MimeMessage</A></B>(<A HREF="../../../javax/mail/Folder.html">Folder</A>&nbsp;folder,
            java.io.InputStream&nbsp;is,
            int&nbsp;msgnum)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a MimeMessage by reading and parsing the data from the
 specified MIME InputStream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected </CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#MimeMessage(javax.mail.Folder, int)">MimeMessage</A></B>(<A HREF="../../../javax/mail/Folder.html">Folder</A>&nbsp;folder,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?