mimemessage.html

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

HTML
1,254 行
字号
			of existing values<DD>IllegalStateException - if this message is
			obtained from a READ_ONLY folder.<DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Message.html#setFrom(javax.mail.Address)">setFrom</A> in class <A HREF="../../../javax/mail/Message.html">Message</A></DL>
</DD>
</DL>
<HR>

<A NAME="setFrom()"><!-- --></A><H3>
setFrom</H3>
<PRE>
public void <B>setFrom</B>()
             throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the RFC 822 "From" header field using the value of the
 <code>InternetAddress.getLocalAddress</code> method.<DD><DL>
<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
			implementation does not support modification
			of existing values<DD>IllegalStateException - if this message is
			obtained from a READ_ONLY folder.<DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Message.html#setFrom()">setFrom</A> in class <A HREF="../../../javax/mail/Message.html">Message</A></DL>
</DD>
</DL>
<HR>

<A NAME="addFrom(javax.mail.Address[])"><!-- --></A><H3>
addFrom</H3>
<PRE>
public void <B>addFrom</B>(<A HREF="../../../javax/mail/Address.html">Address</A>[]&nbsp;addresses)
             throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Add the specified addresses to the existing "From" field. If
 the "From" field does not already exist, it is created.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>addresses</CODE> - the senders of this message<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
			implementation does not support modification
			of existing values<DD>IllegalStateException - if this message is
			obtained from a READ_ONLY folder.<DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Message.html#addFrom(javax.mail.Address[])">addFrom</A> in class <A HREF="../../../javax/mail/Message.html">Message</A></DL>
</DD>
</DL>
<HR>

<A NAME="getRecipients(javax.mail.Message.RecipientType)"><!-- --></A><H3>
getRecipients</H3>
<PRE>
public <A HREF="../../../javax/mail/Address.html">Address</A>[] <B>getRecipients</B>(<A HREF="../../../javax/mail/Message.RecipientType.html">Message.RecipientType</A>&nbsp;type)
                        throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns the recepients specified by the type. The mapping
 between the type and the corresponding RFC 822 header is
 as follows:
 <pre>
		Message.RecipientType.TO		"To"
		Message.RecipientType.CC		"Cc"
		Message.RecipientType.BCC		"Bcc"
		MimeMessage.RecipientType.NEWSGROUPS	"Newsgroups"
 </pre><br>

 Returns null if the header specified by the type is not found
 or if its value is empty. <p>

 This implementation uses the <code>getHeader</code> method
 to obtain the requisite header field.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>Type</CODE> - of recepient<DT><B>Returns:</B><DD>array of Address objects<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - if header could not
                  be retrieved<DD><A HREF="../../../javax/mail/internet/AddressException.html">AddressException</A> - if the header is misformatted<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Message.html#getRecipients(javax.mail.Message.RecipientType)">getRecipients</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>, 
<A HREF="../../../javax/mail/Message.RecipientType.html#TO"><CODE>Message.RecipientType.TO</CODE></A>, 
<A HREF="../../../javax/mail/Message.RecipientType.html#CC"><CODE>Message.RecipientType.CC</CODE></A>, 
<A HREF="../../../javax/mail/Message.RecipientType.html#BCC"><CODE>Message.RecipientType.BCC</CODE></A>, 
<A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html#NEWSGROUPS"><CODE>MimeMessage.RecipientType.NEWSGROUPS</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getAllRecipients()"><!-- --></A><H3>
getAllRecipients</H3>
<PRE>
public <A HREF="../../../javax/mail/Address.html">Address</A>[] <B>getAllRecipients</B>()
                           throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Get all the recipient addresses for the message.
 Extracts the TO, CC, BCC, and NEWSGROUPS recipients.<DD><DL>
<DT><B>Returns:</B><DD>array of Address objects<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#getAllRecipients()">getAllRecipients</A> in class <A HREF="../../../javax/mail/Message.html">Message</A><DT><B>See Also: </B><DD><A HREF="../../../javax/mail/Message.RecipientType.html#TO"><CODE>Message.RecipientType.TO</CODE></A>, 
<A HREF="../../../javax/mail/Message.RecipientType.html#CC"><CODE>Message.RecipientType.CC</CODE></A>, 
<A HREF="../../../javax/mail/Message.RecipientType.html#BCC"><CODE>Message.RecipientType.BCC</CODE></A>, 
<A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html#NEWSGROUPS"><CODE>MimeMessage.RecipientType.NEWSGROUPS</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="setRecipients(javax.mail.Message.RecipientType, javax.mail.Address[])"><!-- --></A><H3>
setRecipients</H3>
<PRE>
public void <B>setRecipients</B>(<A HREF="../../../javax/mail/Message.RecipientType.html">Message.RecipientType</A>&nbsp;type,
                          <A HREF="../../../javax/mail/Address.html">Address</A>[]&nbsp;addresses)
                   throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the specified recipient type to the given addresses.
 If the address parameter is <code>null</code>, the corresponding
 recipient field is removed.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>type</CODE> - Recipient type<DD><CODE>addresses</CODE> - Addresses<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
			implementation does not support modification
			of existing values<DD>IllegalStateException - if this message is
			obtained from a READ_ONLY folder.<DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Message.html#setRecipients(javax.mail.Message.RecipientType, javax.mail.Address[])">setRecipients</A> in class <A HREF="../../../javax/mail/Message.html">Message</A><DT><B>See Also: </B><DD><A HREF="../../../javax/mail/internet/MimeMessage.html#getRecipients(javax.mail.Message.RecipientType)"><CODE>getRecipients(javax.mail.Message.RecipientType)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="addRecipients(javax.mail.Message.RecipientType, javax.mail.Address[])"><!-- --></A><H3>
addRecipients</H3>
<PRE>
public void <B>addRecipients</B>(<A HREF="../../../javax/mail/Message.RecipientType.html">Message.RecipientType</A>&nbsp;type,
                          <A HREF="../../../javax/mail/Address.html">Address</A>[]&nbsp;addresses)
                   throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Add the given addresses to the specified recipient type.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>type</CODE> - Recipient type<DD><CODE>addresses</CODE> - Addresses<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
			implementation does not support modification
			of existing values<DD>IllegalStateException - if this message is
			obtained from a READ_ONLY folder.<DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Message.html#addRecipients(javax.mail.Message.RecipientType, javax.mail.Address[])">addRecipients</A> in class <A HREF="../../../javax/mail/Message.html">Message</A></DL>
</DD>
</DL>
<HR>

<A NAME="getReplyTo()"><!-- --></A><H3>
getReplyTo</H3>
<PRE>
public <A HREF="../../../javax/mail/Address.html">Address</A>[] <B>getReplyTo</B>()
                     throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return the value of the RFC 822 "Reply-To" header field. If
 this header is unavailable or its value is absent, then
 the <code>getFrom</code> method is called and its value is returned.

 This implementation uses the <code>getHeader</code> method
 to obtain the requisite header field.<DD><DL>
<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#getReplyTo()">getReplyTo</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="setReplyTo(javax.mail.Address[])"><!-- --></A><H3>
setReplyTo</H3>
<PRE>
public void <B>setReplyTo</B>(<A HREF="../../../javax/mail/Address.html">Address</A>[]&nbsp;addresses)
                throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the RFC 822 "Reply-To" header field. If the address 
 parameter is <code>null</code>, this header is removed.<DD><DL>
<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
			implementation does not support modification
			of existing values<DD>IllegalStateException - if this message is
			obtained from a READ_ONLY folder.<DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Message.html#setReplyTo(javax.mail.Address[])">setReplyTo</A> in class <A HREF="../../../javax/mail/Message.html">Message</A></DL>
</DD>
</DL>
<HR>

<A NAME="getSubject()"><!-- --></A><H3>
getSubject</H3>
<PRE>
public java.lang.String <B>getSubject</B>()
                            throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns the value of the "Subject" header field. Returns null 
 if the subject field is unavailable or its value is absent. <p>

 If the subject is encoded as per RFC 2047, it is decoded and
 converted into Unicode. If the decoding or conversion fails, the
 raw data is returned as is. <p>

 This implementation uses the <code>getHeader</code> method
 to obtain the requisite header field.<DD><DL>
<DT><B>Returns:</B><DD>Subject<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#getSubject()">getSubject</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="setSubject(java.lang.String)"><!-- --></A><H3>
setSubject</H3>
<PRE>
public void <B>setSubject</B>(java.lang.String&nbsp;subject)
                throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the "Subject" header field. If the subject contains 
 non US-ASCII characters, it will be encoded using the 
 platform's default charset. If the subject contains only 
 US-ASCII characters, no encoding is done and it is used 
 as-is. If the subject is null, the existing "Subject" field
 is removed. <p>

 Note that if the charset encoding process fails, a
 MessagingException is thrown, and an UnsupportedEncodingException
 is included in the chain of nested exceptions within the
 MessagingException.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - The subject<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
			implementation does not support modification
			of existing values<DD>IllegalStateException - if this message is
			obtained from a READ_ONLY folder.<DD>MessagingException. - An
 			UnsupportedEncodingException may be included
			in the exception chain if the charset
			conversion fails.<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Message.html#setSubject(java.lang.String)">setSubject</A> in class <A HREF="../../../javax/mail/Message.html">Message</A></DL>
</DD>
</DL>
<HR>

<A NAME="setSubject(java.lang.String, java.lang.String)"><!-- --></A><H3>
setSubject</H3>
<PRE>
public void <B>setSubject</B>(java.lang.String&nbsp;subject,
                       java.lang.String&nbsp;charset)
                throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the "Subject" header field. If the subject contains non 
 US-ASCII characters, it will be encoded using the specified
 charset. If the subject contains only US-ASCII characters, no 
 encoding is done and it is used as-is. If the subject is null, 
 the existing "Subject" header field is removed. <p>

 Note that if the charset encoding process fails, a
 MessagingException is thrown, and an UnsupportedEncodingException
 is included in the chain of nested exceptions within the
 MessagingException.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>subject</CODE> - The subject<DD><CODE>charset</CODE> - The charset<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
				implementation does not support modification
				of existing values<DD>IllegalStateException - if this message is
				obtained from a READ_ONLY folder.<DD>MessagingException. - An
 				UnsupportedEncodingException may be included
				in the exception chain if the charset
				conversion fails.</DL>
</DD>
</DL>
<HR>

<A NAME="getSentDate()"><!-- --></A><H3>
getSentDate</H3>
<PRE>
public java.util.Date <B>getSentDate</B>()
                           throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns the value of the RFC 822 "Date" field. This is the date 
 on which this message was sent. Returns null if this field is 
 unavailable or its value is absent. <p>
 
 This implementation uses the <code>getHeader</code> method
 to obtain the requisite header field.<DD><DL>
<DT><B>Returns:</B><DD>The sent Date<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#getSentDate()">getSentDate</A> in class <A HREF="../../../javax/mail/Message.html">Message</A></DL>
</DD>
</DL>
<HR>

<A NAME="setSentDate(java.util.Date)"><!-- --></A><H3>
setSentDate</H3>
<PRE>
public void <B>setSentDate</B>(java.util.Date&nbsp;d)
                 throws <A HREF="../../../javax/mail/MessagingException.html">MessagingExcepti

⌨️ 快捷键说明

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