- java.lang.Object
-
- javax.mail.Message.RecipientType
-
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- MimeMessage.RecipientType
- Enclosing class:
- Message
public static class Message.RecipientType extends Object implements Serializable
This inner class defines the types of recipients allowed by the Message class. The currently defined types are TO, CC and BCC. Note that this class only has a protected constructor, thereby restricting new Recipient types to either this class or subclasses. This effectively implements an enumeration of the allowed Recipient types. The following code sample shows how to use this class to obtain the "TO" recipients from a message.Message msg = folder.getMessages(1); Address[] a = m.getRecipients(Message.RecipientType.TO);
-
-
Field Summary
Fields Modifier and Type Field and Description static Message.RecipientType
BCC
The "Bcc" (blind carbon copy) recipients.static Message.RecipientType
CC
The "Cc" (carbon copy) recipients.static Message.RecipientType
TO
The "To" (primary) recipients.protected String
type
The type of recipient, usually the name of a corresponding Internet standard header.
-
Constructor Summary
Constructors Modifier Constructor and Description protected
RecipientType(String type)
Constructor for use by subclasses.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description protected Object
readResolve()
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class.String
toString()
-
-
-
Field Detail
-
TO
public static final Message.RecipientType TO
The "To" (primary) recipients.
-
CC
public static final Message.RecipientType CC
The "Cc" (carbon copy) recipients.
-
BCC
public static final Message.RecipientType BCC
The "Bcc" (blind carbon copy) recipients.
-
type
protected String type
The type of recipient, usually the name of a corresponding Internet standard header.
-
-
Constructor Detail
-
RecipientType
protected RecipientType(String type)
Constructor for use by subclasses.
-
-
Method Detail
-
readResolve
protected Object readResolve() throws ObjectStreamException
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class. Subclasses must implement their ownreadResolve
method that checks for their known instances before calling this super method.- Throws:
ObjectStreamException
-
-
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/mail/message.recipienttype.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.