📄 mimemessage.html
字号:
<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> charset)</CODE><BR> 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 void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#updateHeaders()">updateHeaders</A></B>()</CODE><BR> 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> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#writeTo(java.io.OutputStream)">writeTo</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/OutputStream.html" title="class or interface in java.io">OutputStream</A> os)</CODE><BR> 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> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMessage.html#writeTo(java.io.OutputStream, java.lang.String[])">writeTo</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/OutputStream.html" title="class or interface in java.io">OutputStream</A> os, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] ignoreList)</CODE><BR> Output the message as an RFC 822 format stream, without specified headers. </TD></TR></TABLE> <A NAME="methods_inherited_from_class_javax.mail.Message"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class javax.mail.<A HREF="../../../javax/mail/Message.html" title="class in javax.mail">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> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><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" title="class in javax.activation">DataHandler</A> <B>dh</B></PRE><DL><DD>The DataHandler object representing this Message's content.<P><DL></DL></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.<P><DL></DL></DL><HR><A NAME="contentStream"><!-- --></A><H3>contentStream</H3><PRE>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> <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.<P><DL><DT><B>Since:</B></DT> <DD>JavaMail 1.2</DD></DL></DL><HR><A NAME="headers"><!-- --></A><H3>headers</H3><PRE>protected <A HREF="../../../javax/mail/internet/InternetHeaders.html" title="class in javax.mail.internet">InternetHeaders</A> <B>headers</B></PRE><DL><DD>The InternetHeaders object that stores the header of this message.<P><DL></DL></DL><HR><A NAME="flags"><!-- --></A><H3>flags</H3><PRE>protected <A HREF="../../../javax/mail/Flags.html" title="class in javax.mail">Flags</A> <B>flags</B></PRE><DL><DD>The Flags for this message.<P><DL></DL></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.<P><DL><DT><B>Since:</B></DT> <DD>JavaMail 1.2</DD></DL></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.<P><DL><DT><B>Since:</B></DT> <DD>JavaMail 1.2</DD></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="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" title="class in javax.mail">Session</A> 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. The <code>modified</code> flag is set to true.<P></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" title="class in javax.mail">Session</A> session, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> is) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">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> The input stream contains an entire MIME formatted message with headers and data.<P><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><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL><HR><A NAME="MimeMessage(javax.mail.internet.MimeMessage)"><!-- --></A><H3>MimeMessage</H3><PRE>public <B>MimeMessage</B>(<A HREF="../../../javax/mail/internet/MimeMessage.html" title="class in javax.mail.internet">MimeMessage</A> source) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Constructs a new MimeMessage with content initialized from the <code>source</code> MimeMessage. The new message is independent of the original. <p> Note: The current implementation is rather inefficient, copying the data more times than strictly necessary.<P><DT><B>Parameters:</B><DD><CODE>source</CODE> - the message to copy content from<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -