📄 mimemessage.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2_02) on Thu Nov 13 17:20:43 PST 2003 --><TITLE>MimeMessage (Java 2 Platform Ent. Ed. v1.4)</TITLE><META NAME="keywords" CONTENT="javax.mail.internet.MimeMessage class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="MimeMessage (Java 2 Platform Ent. Ed. v1.4)";}</SCRIPT></HEAD><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=""><TR><TD COLSPAN=3 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="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-all.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> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Ent. Ed. v1.4</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/mail/internet/MimeBodyPart.html" title="class in javax.mail.internet"><B>PREV CLASS</B></A> <A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html" title="class in javax.mail.internet"><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> <A HREF="MimeMessage.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>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.mail.internet</FONT><BR>Class MimeMessage</H2><PRE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">java.lang.Object</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../javax/mail/Message.html" title="class in javax.mail">javax.mail.Message</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>javax.mail.internet.MimeMessage</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</A>, <A HREF="../../../javax/mail/Part.html" title="interface in javax.mail">Part</A></DD></DL><HR><DL><DT>public class <B>MimeMessage</B><DT>extends <A HREF="../../../javax/mail/Message.html" title="class in javax.mail">Message</A><DT>implements <A HREF="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">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 top level RFC 822 headers of a message. <p> The <code>mail.mime.address.strict</code> session property controls the parsing of address headers. By default, strict parsing of address headers is done. If this property is set to <code>"false"</code>, strict parsing is not done and many illegal addresses that sometimes occur in real messages are allowed. See the <code>InternetAddress</code> class for details. <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><P><DL><DT><B>Author:</B></DT> <DD>John Mani, Bill Shannon, Max Spivak</DD><DT><B>See Also:</B><DD><A HREF="../../../javax/mail/internet/MimeUtility.html" title="class in javax.mail.internet"><CODE>MimeUtility</CODE></A>, <A HREF="../../../javax/mail/Part.html" title="interface in javax.mail"><CODE>Part</CODE></A>, <A HREF="../../../javax/mail/Message.html" title="class in javax.mail"><CODE>Message</CODE></A>, <A HREF="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet"><CODE>MimePart</CODE></A>, <A HREF="../../../javax/mail/internet/InternetAddress.html" title="class in javax.mail.internet"><CODE>InternetAddress</CODE></A></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><A NAME="nested_class_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Nested Class Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static class</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html" title="class in javax.mail.internet">MimeMessage.RecipientType</A></B></CODE><BR> This inner class extends the javax.mail.Message.RecipientType class to add additional RecipientTypes. </TD></TR></TABLE> <!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><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 byte[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#content">content</A></B></CODE><BR> 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 <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#contentStream">contentStream</A></B></CODE><BR> 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 <A HREF="../../../javax/activation/DataHandler.html" title="class in javax.activation">DataHandler</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#dh">dh</A></B></CODE><BR> 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 <A HREF="../../../javax/mail/Flags.html" title="class in javax.mail">Flags</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#flags">flags</A></B></CODE><BR> The Flags for this message.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../../javax/mail/internet/InternetHeaders.html" title="class in javax.mail.internet">InternetHeaders</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#headers">headers</A></B></CODE><BR> 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 boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#modified">modified</A></B></CODE><BR> A flag indicating whether the message has been modified. </TD></TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -