This is a class that models an email message. Protocol specific subclasses provide the actual implementations. Note that this class defines additional attributes beyond those included in the Part interface, including message recipients, senders, flags and subject.

Where supported by the underlying protocol, data will be read into the Message object as requested by the get methods, rather than when the Message is retrieved from the folder that contains it.

public abstract class Message implements Part {
// Protected Constructors
   protected Message();  
   protected Message( javax.mail.Session session);  
   protected Message( Folder folder, int msgnum);  
// Inner Classes
   public static class RecipientType implements Serializable; 
// Property Accessor Methods (by property name)
   public abstract java.util.Enumeration getAllHeaders(          // Implements:Part
        ) throws MessagingException;  
   public Address[] getAllRecipients(
        ) throws MessagingException;  
   public abstract Object getContent(                            // Implements:Part
        ) throws IOExceptionMessagingException;  
   public abstract void setContent(                              // Implements:Part
        Multipart mp) throws MessagingException;  
   public abstract void setContent(Object obj,                   // Implements:Part
        String type) throws MessagingException;  
   public abstract String getContentType(                        // Implements:Part
        ) throws MessagingException;  
   public abstract javax.activation.DataHandler getDataHandler(  // ...

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.