mimemessage.html

来自「SUN的JAVA MAIL API」· HTML 代码 · 共 1,254 行 · 第 1/5 页

HTML
1,254 行
字号
<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" ID="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" ID="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" ID="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" ID="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" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class javax.mail.<A HREF="../../../javax/mail/Message.html">Message</A></B></TD>
</TR>
<TR BGCOLOR="white" ID="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" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" ID="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" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="dh"><!-- --></A><H3>
dh</H3>
<PRE>
protected javax.activation.DataHandler <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="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>

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

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

<A NAME="MimeMessage(javax.mail.Session)"><!-- --></A><H3>
MimeMessage</H3>
<PRE>
public <B>MimeMessage</B>(<A HREF="../../../javax/mail/Session.html">Session</A>&nbsp;session)</PRE>
<DL>
<DD>Default constructor. An empty message object is created.
 The <code>headers</code> field is set to an empty InternetHeaders
 object. The <code>flags</code> field is set to an empty Flags
 object.</DL>
<HR>

<A NAME="MimeMessage(javax.mail.Session, java.io.InputStream)"><!-- --></A><H3>
MimeMessage</H3>
<PRE>
public <B>MimeMessage</B>(<A HREF="../../../javax/mail/Session.html">Session</A>&nbsp;session,
                   java.io.InputStream&nbsp;is)
            throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Constructs a MimeMessage by reading and parsing the data from the
 specified MIME InputStream. The InputStream will be left positioned
 at the end of the data for the message. Note that the input stream
 parse is done within this constructor itself.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>session</CODE> - Session object for this message<DD><CODE>is</CODE> - the message input stream<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;</DL>
</DD>
</DL>
<HR>

<A NAME="MimeMessage(javax.mail.Folder, int)"><!-- --></A><H3>
MimeMessage</H3>
<PRE>
protected <B>MimeMessage</B>(<A HREF="../../../javax/mail/Folder.html">Folder</A>&nbsp;folder,
                      int&nbsp;msgnum)</PRE>
<DL>
<DD>Constructs an empty MimeMessage object with the given Folder
 and message number. <p>

 This method is for providers subclassing <code>MimeMessage</code>.</DL>
<HR>

<A NAME="MimeMessage(javax.mail.Folder, java.io.InputStream, int)"><!-- --></A><H3>
MimeMessage</H3>
<PRE>
protected <B>MimeMessage</B>(<A HREF="../../../javax/mail/Folder.html">Folder</A>&nbsp;folder,
                      java.io.InputStream&nbsp;is,
                      int&nbsp;msgnum)
               throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Constructs a MimeMessage by reading and parsing the data from the
 specified MIME InputStream. The InputStream will be left positioned
 at the end of the data for the message. Note that the input stream
 parse is done within this constructor itself. <p>

 This method is for providers subclassing <code>MimeMessage</code>.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>folder</CODE> - The containing folder.<DD><CODE>is</CODE> - the message input stream<DD><CODE>msgnum</CODE> - Message number of this message within its folder<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;</DL>
</DD>
</DL>
<HR>

<A NAME="MimeMessage(javax.mail.Folder, javax.mail.internet.InternetHeaders, byte[], int)"><!-- --></A><H3>
MimeMessage</H3>
<PRE>
protected <B>MimeMessage</B>(<A HREF="../../../javax/mail/Folder.html">Folder</A>&nbsp;folder,
                      <A HREF="../../../javax/mail/internet/InternetHeaders.html">InternetHeaders</A>&nbsp;headers,
                      byte[]&nbsp;content,
                      int&nbsp;msgnum)
               throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Constructs a MimeMessage from the given InternetHeaders object
 and content.

 This method is for providers subclassing <code>MimeMessage</code>.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>folder</CODE> - The containing folder.<DD><CODE>is</CODE> - the message input stream<DD><CODE>msgnum</CODE> - Message number of this message within its folder<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;</DL>
</DD>
</DL>

<!-- ============ METHOD DETAIL ========== -->

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

<A NAME="getFrom()"><!-- --></A><H3>
getFrom</H3>
<PRE>
public <A HREF="../../../javax/mail/Address.html">Address</A>[] <B>getFrom</B>()
                  throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns the value of the RFC 822 "From" header fields. If this 
 header field is absent, the "Sender" header field is used. 
 If the "Sender" header field is also absent, <code>null</code>
 is returned.<p>

 This implementation uses the <code>getHeader</code> method
 to obtain the requisite header field.<DD><DL>
<DT><B>Returns:</B><DD>Address object<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Message.html#getFrom()">getFrom</A> in class <A HREF="../../../javax/mail/Message.html">Message</A><DT><B>See Also: </B><DD><A HREF="../../../javax/mail/internet/MimeMessage.html#headers"><CODE>headers</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setFrom(javax.mail.Address)"><!-- --></A><H3>
setFrom</H3>
<PRE>
public void <B>setFrom</B>(<A HREF="../../../javax/mail/Address.html">Address</A>&nbsp;address)
             throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the RFC 822 "From" header field. Any existing values are 
 replaced with the given address. If address is <code>null</code>,
 this header is removed.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>address</CODE> - the sender of this message<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
			implementation does not support modification

⌨️ 快捷键说明

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