mimemessage.html

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

HTML
1,271
字号
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setFlags(javax.mail.Flags, boolean)">setFlags</A></B>(<A HREF="../../../javax/mail/Flags.html">Flags</A>&nbsp;flag,
         boolean&nbsp;set)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the flags for this message.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setFrom()">setFrom</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the RFC 822 "From" header field using the value of the
 <code>InternetAddress.getLocalAddress</code> method.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setFrom(javax.mail.Address)">setFrom</A></B>(<A HREF="../../../javax/mail/Address.html">Address</A>&nbsp;address)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the RFC 822 "From" header field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setHeader(java.lang.String, java.lang.String)">setHeader</A></B>(java.lang.String&nbsp;name,
          java.lang.String&nbsp;value)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the value for this header_name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setRecipients(javax.mail.Message.RecipientType, javax.mail.Address[])">setRecipients</A></B>(<A HREF="../../../javax/mail/Message.RecipientType.html">Message.RecipientType</A>&nbsp;type,
              <A HREF="../../../javax/mail/Address.html">Address</A>[]&nbsp;addresses)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the specified recipient type to the given addresses.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setRecipients(javax.mail.Message.RecipientType, java.lang.String)">setRecipients</A></B>(<A HREF="../../../javax/mail/Message.RecipientType.html">Message.RecipientType</A>&nbsp;type,
              java.lang.String&nbsp;addresses)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the specified recipient type to the given addresses.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setReplyTo(javax.mail.Address[])">setReplyTo</A></B>(<A HREF="../../../javax/mail/Address.html">Address</A>[]&nbsp;addresses)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the RFC 822 "Reply-To" header field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setSentDate(java.util.Date)">setSentDate</A></B>(java.util.Date&nbsp;d)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the RFC 822 "Date" header field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setSubject(java.lang.String)">setSubject</A></B>(java.lang.String&nbsp;subject)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the "Subject" header field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setSubject(java.lang.String, java.lang.String)">setSubject</A></B>(java.lang.String&nbsp;subject,
           java.lang.String&nbsp;charset)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the "Subject" header field.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setText(java.lang.String)">setText</A></B>(java.lang.String&nbsp;text)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience method that sets the given String as this
 part's content, with a MIME type of "text/plain".</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#setText(java.lang.String, java.lang.String)">setText</A></B>(java.lang.String&nbsp;text,
        java.lang.String&nbsp;charset)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Convenience method that sets the given String as this part's
 content, with a MIME type of "text/plain" and the specified
 charset.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#updateHeaders()">updateHeaders</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Called by the <code>saveChanges</code> method to actually
 update the MIME headers.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#writeTo(java.io.OutputStream)">writeTo</A></B>(java.io.OutputStream&nbsp;os)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Output the message as an RFC 822 format stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#writeTo(java.io.OutputStream, java.lang.String[])">writeTo</A></B>(java.io.OutputStream&nbsp;os,
        java.lang.String[]&nbsp;ignoreList)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Output the message as an RFC 822 format stream, without
 specified headers.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.mail.Message"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods 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#addRecipient(javax.mail.Message.RecipientType, javax.mail.Address)">addRecipient</A>, <A HREF="../../../javax/mail/Message.html#getFolder()">getFolder</A>, <A HREF="../../../javax/mail/Message.html#getMessageNumber()">getMessageNumber</A>, <A HREF="../../../javax/mail/Message.html#isExpunged()">isExpunged</A>, <A HREF="../../../javax/mail/Message.html#match(javax.mail.search.SearchTerm)">match</A>, <A HREF="../../../javax/mail/Message.html#setExpunged(boolean)">setExpunged</A>, <A HREF="../../../javax/mail/Message.html#setFlag(javax.mail.Flags.Flag, boolean)">setFlag</A>, <A HREF="../../../javax/mail/Message.html#setMessageNumber(int)">setMessageNumber</A>, <A HREF="../../../javax/mail/Message.html#setRecipient(javax.mail.Message.RecipientType, javax.mail.Address)">setRecipient</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="dh"><!-- --></A><H3>
dh</H3>
<PRE>
protected <A HREF="../../../javax/activation/DataHandler.html">DataHandler</A> <B>dh</B></PRE>
<DL>
<DD>The DataHandler object representing this Message's content.</DL>
<HR>

<A NAME="content"><!-- --></A><H3>
content</H3>
<PRE>
protected byte[] <B>content</B></PRE>
<DL>
<DD>Byte array that holds the bytes of this Message's content.</DL>
<HR>

<A NAME="contentStream"><!-- --></A><H3>
contentStream</H3>
<PRE>
protected java.io.InputStream <B>contentStream</B></PRE>
<DL>
<DD>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.  In this case, <code>content</code>
 will be null.<DD><DL>
<DT><B>Since: </B><DD>JavaMail 1.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="headers"><!-- --></A><H3>
headers</H3>
<PRE>
protected <A HREF="../../../javax/mail/internet/InternetHeaders.html">InternetHeaders</A> <B>headers</B></PRE>
<DL>
<DD>The InternetHeaders object that stores the header
 of this message.</DL>
<HR>

<A NAME="flags"><!-- --></A><H3>
flags</H3>
<PRE>
protected <A HREF="../../../javax/mail/Flags.html">Flags</A> <B>flags</B></PRE>
<DL>
<DD>The Flags for this message.</DL>
<HR>

<A NAME="modified"><!-- --></A><H3>
modified</H3>
<PRE>
protected boolean <B>modified</B></PRE>
<DL>
<DD>A flag indicating whether the message has been modified.
 If the message has not been modified, any data in the
 <code>content</code> array is assumed to be valid and is used
 directly in the <code>writeTo</code> method.  This flag is
 set to true when an empty message is created or when the
 <code>saveChanges</code> method is called.<DD><DL>
<DT><B>Since: </B><DD>JavaMail 1.2</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="saved"><!-- --></A><H3>
saved</H3>
<PRE>
protected boolean <B>saved</B></PRE>
<DL>
<DD>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.  The
 <code>writeTo</code> method checks this flag and calls the
 <code>saveChanges</code> method as necessary.  This avoids the
 common mistake of forgetting to call the <code>saveChanges</code>
 method on a newly constructed message.<DD><DL>
<DT><B>Since: </B><DD>JavaMail 1.2</DD>
</DL>
</DD>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

⌨️ 快捷键说明

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