com.aspose.email

com.aspose.email

Class MessageObject

All Implemented Interfaces:
IMessageObjectPropertyContainer
public final class MessageObject
extends Object
implements IMessageObjectPropertyContainer

Represents an Outlook message object. Evaluation limits: only 1 attachment and 1 recipient are read when message is being loaded, watermark will be added when the message is being saved.

Constructor Summary
MessageObject(InputStream stream, intloadFormat)
MessageObject(String fileName, intloadFormat)
Initializes a new instance of the MessageObject class.
 
Method Summary
getAttachments()
Gets the attachments of the MessageObject.
int
getCodepage()
Gets the codepage used to encode/decode string properties in case MapiType.PT_STRING8 type for them is used.
int
getIdForNamedProperty()
Gets the id to be used for named property, named properties are special properties and should have their ids in range [0x8000,0xfffe] aligned starting from 0x8000 sequentally.
getProperties()
Gets the properties of the MessageObject.
getRecipients()
Gets the recipients of the MessageObject.
void
save(OutputStream stream, intformat)
void
save(String fileName, intformat)
Saves the current message object to the specified file.
 
Methods inherited from class java.lang.Object
 

    • Constructor Detail

      • MessageObject

        public MessageObject(InputStream stream,
                             int loadFormat)
      • MessageObject

        public MessageObject(String fileName,
                             int loadFormat)

        Initializes a new instance of the MessageObject class.

        Parameters:
        fileName - Name of the file to read from.
        loadFormat - The source format message object is stored with.

        In addition same set of exceptions could be thrown as for the File.Open(string,System.IO.FileMode) call.

        Throws:
        com.aspose.email.ms.System.IllegalArgumentException - If specified loadFormat is not supported.
    • Method Detail

      • getCodepage

        public int getCodepage()

        Gets the codepage used to encode/decode string properties in case MapiType.PT_STRING8 type for them is used.

        Value: The codepage.

      • save

        public void save(String fileName,
                         int format)

        Saves the current message object to the specified file.

        Parameters:
        fileName - Name of the file.
        format - The format of the output data.

        In addition same set of exceptions could be thrown as for the File.OpenWrite call.

        Throws:
        com.aspose.email.ms.System.IllegalArgumentException - If format value is not valid.
      • getIdForNamedProperty

        public int getIdForNamedProperty()

        Gets the id to be used for named property, named properties are special properties and should have their ids in range [0x8000,0xfffe] aligned starting from 0x8000 sequentally. Use this method to find the available id cause it could be hard to calculate it yourself.

        Returns:
        Available id for the named property.