SHOW Signed
 

net.rim.blackberry.api.mail
Class Message

java.lang.Object
  |
  +--net.rim.blackberry.api.mail.Message
All Implemented Interfaces:
Part

public class Message
extends Object
implements Part

Represents an email message.

The Message class implements the Part interface. A message contains a set of header fields (attributes) and a body (contents). Messages in a folder also have a set of flags that describe its state within the folder.

Message defines some new attributes in addition to those defined in the Part interface. These attributes provide addressing and descriptive information about the message.

Message objects can be obtained from a Folder object. Received messages are normally retrieved from a folder named "INBOX". A message obtained from a folder is just a reference to the actual message. The message is filled up on demand when each item is requested from the message. Note that certain folder implementations might return Message objects that are pre-filled with certain user-specified items.

To send a message, create a Message object, fill in the attributes and content, and invoke Transport.send(net.rim.blackberry.api.mail.Message).

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 3.6.0
See Also:
Address

Inner Class Summary
 Category: Signed static interface Message.Flag
          Defines the flags supported by the Message class.
 Category: Signed static interface Message.Icons
          Defines character representations of the various message status icons.
 Category: Signed static interface Message.Priority
          Defines priorities for messages.
 Category: Signed static interface Message.RecipientType
          Defines the types of recipients supported by the Message class.
 Category: Signed static interface Message.Status
          Defines the status options supported by the Message class.
 
Field Summary
 Category: Signed static int EMAIL_MESSAGE
           
 Category: Signed static int PIN_MESSAGE
          NOTE: Not in 3.8 version software
 
Fields inherited from interface net.rim.blackberry.api.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
 Category: Signed Message()
          Creates a new Message instance.
 Category: Signed Message(Folder folder)
          Creates a new Message to store in a provided folder.
 
Method Summary
 Category: Signed  void addHeader(String header, String value)
          Adds a value to list of values for header by name.
 Category: Signed  void addMessageListener(MessageListener listener)
          Adds a message listener to this message.
 Category: Signed  void addRecipient(int type, Address address)
          Adds the specified address as a recipient of this message of the specified type.
 Category: Signed  void addRecipients(int type, Address[] addresses)
          Adds recipient addresses.
 Category: Signed  void clearFlags(int mask)
          Clears flags for this message.
 Category: Signed  boolean equals(Object o)
          Determines if two object instances are the same.
 Category: Signed  Message forward()
          Creates a new message object suitable for forwarding this message.
 Category: Signed  Enumeration getAllHeaders()
          Retrieves all the headers from this part as an enumeration of Header objects.
 Category: Signed  String getBodyText()
          Retrieves the body text for this message.
 Category: Signed  Object getContent()
          Retrieves this message's body content.
 Category: Signed  String getContentType()
          Retrieves this message's content-type.
 Category: Signed  int getFlags()
          Retrieves the flags for this message.
 Category: Signed  Folder getFolder()
          Retrieves the folder containing this message.
 Category: Signed  Address getFrom()
          Retrieves this message's "From" attribute.
 Category: Signed  String[] getHeader(String header)
          Retrieves all headers by name.
 Category: Signed  InputStream getInputStream()
          Retrieves an input stream for this message's contents.
 Category: Signed  int getMessageId()
          Retrieves the integer ID of this message.
 Category: Signed  int getMessageType()
          Returns the type of message
 Category: Signed  byte getPriority()
          Returns the priority of the Message.
 Category: Signed  Date getReceivedDate()
          Retrieves the received-date for this message.
 Category: Signed  Address[] getRecipients(int type)
          Retrieves all the recipient addresses for the message based on recipient type.
 Category: Signed  Address[] getReplyTo()
          Retrieves the addresses to which replies should be directed.
 Category: Signed  Date getSentDate()
          Retrieves the sent-date for this message.
 Category: Signed  int getSize()
          Retrieves the size for this message's content.
 Category: Signed  int getStatus()
          Retrieves the status of this message.
 Category: Signed  String getSubject()
          Retrieves the subject of this message.
 Category: Signed  int getTransmissionError()
          Retrieves the transmission error code for this message.
 Category: Signed  int hashCode()
          Retrieves a hash code value for this message.
 Category: Signed  boolean isInbound()
          Determines if this message is an inbound (received) message.
 Category: Signed  boolean isMimeType(String mimeType)
          Determines if this message's content-type matches provided type.
 Category: Signed  boolean isSet(int flag)
          Determines if the specified flag is set on this message.
 Category: Signed  boolean removeAllRecipients(int type)
          Removes all the recipients of the type specified.
 Category: Signed  void removeHeader(String header)
          Removes all headers by name.
 Category: Signed  void removeMessageListener(MessageListener listener)
          Removes a message listener from this message.
 Category: Signed  boolean removeRecipients(int type, Address[] list)
          Removes all the recipients of the type specified from the array of Addresses
 Category: Signed  Message reply(boolean replyToAll)
          Retrieves a new message object suitable for a reply to this message.
 Category: Signed  Message reply(boolean replyToAll, boolean replyWithOriginalText)
          Retrieves a new message object suitable for a reply to this message.
 Category: Signed  void setContent(Object content)
          Sets the contents (body) for this message.
 Category: Signed  void setFlag(int flag, boolean set)
          Sets or clears the specified flag on this message.
 Category: Signed  void setFlags(int mask)
          Sets flags for this message.
 Category: Signed  void setFrom(Address address)
          Sets this message's "From" attribute.
 Category: Signed  void setHeader(String header, String value)
          Sets a value for header by name.
 Category: Signed  void setInbound(boolean b)
          Sets the message status as an inbound (received) message.
 Category: Signed  void setPriority(byte p)
          Sets the priority of the message.
 Category: Signed  void setReplyTo(Address[] addresses)
          Sets the addresses to which replies should be directed.
 Category: Signed  void setSentDate(Date date)
          Sets the sent-date for this message.
 Category: Signed  void setStatus(int messageStatus, int messageTransmissionError)
          Sets the status for this message.
 Category: Signed  void setSubject(String subject)
          Sets the subject for this message.
 Category: Signed  void updateUi()
          Initiates any necessary UI updates.
 Category: Signed  void writeTo(OutputStream os)
          Writes this message out as an RFC 822 format stream.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail


EMAIL_MESSAGE

public static final int EMAIL_MESSAGE
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

PIN_MESSAGE

public static final int PIN_MESSAGE
NOTE: Not in 3.8 version software
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Constructor Detail

Message

public Message()
Creates a new Message instance.

Events on the message, such as status changes, are not distributed until this message is added to a folder, or sent using Transport.

Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Message

public Message(Folder folder)
Creates a new Message to store in a provided folder.

Events on the message, such as status changes, are not distributed until this message is added to a folder, or sent via Transport.

Note: This method does not add the message to the folder, it merely associates it for later transport.

Parameters:
folder - Folder in which to create this new message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail

addHeader

public void addHeader(String header,
                      String value)
Adds a value to list of values for header by name.

  • For TO, BCC, REPLY_TO, FROM and SENDER, a simple email address is expected for value.
  • For DATE, a long-integer date encoded as a string is expected.
Parameters:
header - Name of header to which to add a value.
value - Value to add to named header.
Throws:
IllegalArgumentException - if attempting to add the MESSAGE_ID header
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

addMessageListener

public void addMessageListener(MessageListener listener)
Adds a message listener to this message.

Invoke this method only after invoking Folder.appendMessage(net.rim.blackberry.api.mail.Message) or Transport.send(net.rim.blackberry.api.mail.Message).

Parameters:
listener - Message listener to add to this message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

addRecipient

public void addRecipient(int type,
                         Address address)
                  throws MessagingException
Adds the specified address as a recipient of this message of the specified type.

This is equivalent to addRecipients(type, new Address[] {address}).

Parameters:
type - Type of message recipient (see Message.RecipientType interface; should be Message.RecipientType.TO, Message.RecipientType.CC, or Message.RecipientType.BCC).
address - the address of the recipient to add.
Throws:
IllegalArgumentException - if address==null or Type parameter is not one of the Message.RecipientType.TO, Message.RecipientType.CC, or Message.RecipientType.BCC).
Since:
JDE 4.2.0
See Also:
addRecipients(int, Address[])
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

addRecipients

public void addRecipients(int type,
                          Address[] addresses)
                   throws MessagingException
Adds recipient addresses.
Parameters:
type - Type of message recipient (see Message.RecipientType interface; should be Message.RecipientType.TO, Message.RecipientType.CC, or Message.RecipientType.BCC.
addresses - One or more recipient addresses to add.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

clearFlags

public void clearFlags(int mask)
Clears flags for this message.
Parameters:
mask - Bitfield of flags to clear.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

equals

public boolean equals(Object o)
Determines if two object instances are the same.

Many Message objects can refer to the same message ultimately. Therefore, use this method to determine if two Message instances are identical.

Overrides:
equals in class Object
Parameters:
o - Object to compare with this object.
Returns:
True if the two objects are identical; otherwise, false.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

forward

public Message forward()
Creates a new message object suitable for forwarding this message.

This method uses the capability of the BlackBerry system to forward messages from the mail server.

Returns:
New message object appropriate for forwarding this message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getAllHeaders

public Enumeration getAllHeaders()
Retrieves all the headers from this part as an enumeration of Header objects.

the DATE header will always occur twice, the first entry is always the date RECEIVED (by the handheld) the second is the date SENT (by the originating machine).

A new message created on the device will contain at least one header: the RECEIVED date.

Returns:
Enumeration containing all headers of this part.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getBodyText

public String getBodyText()
Retrieves the body text for this message.
Returns:
Body text for this message, or null if no body text in this message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getContent

public Object getContent()
Retrieves this message's body content.
Returns:
An object containing this message's body content: this is typically a BodyPart object for a text message; for message that includes attachments, a Multipart object is returned.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getContentType

public String getContentType()
Retrieves this message's content-type.
Returns:
MIME content-type for this message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getFlags

public int getFlags()
Retrieves the flags for this message.
Returns:
Bitfield of set flags.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getFolder

public Folder getFolder()
Retrieves the folder containing this message.
Returns:
Folder containing this message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getFrom

public Address getFrom()
                throws MessagingException
Retrieves this message's "From" attribute.
Returns:
Address in this message's "From" (sender) attribute, or null if no "From" attribute set.
Throws:
MessagingException - A general messaging error.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getHeader

public String[] getHeader(String header)
Retrieves all headers by name.

For the DATE header, returns both the received data (index 0) and the sent date (index 1) if applicable. That is, for an inbound message, the received date is the date the device received the message whereas the sent date is the date the sender sent the message.

Parameters:
header - Name of the header for which to retrieve the header data.
Returns:
Array of strings containing the various parts of the header data.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getInputStream

public InputStream getInputStream()
Retrieves an input stream for this message's contents.
Returns:
Input stream for the TextBodyPart of the message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getMessageId

public int getMessageId()
Retrieves the integer ID of this message.

This is a convenience method to retrieve the ID of this message; the message ID is assigned when the message is added to a Folder, or when a message is sent.

  • On an inbound message, this is the id assigned by the BES.
  • On an outbound message this is either 0 if not yet assigned, or the value as assigned by the device after either a folder append operation or send
Returns:
ID for this message.
Since:
JDE 4.0.0
See Also:
Folder.getMessages()
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getMessageType

public int getMessageType()
Returns the type of message
Returns:
The type of message is either Message.PIN_MESSAGE or Message.EMAIL_MESSAGE
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getPriority

public byte getPriority()
Returns the priority of the Message.
Returns:
Priority as defined by the Message.Priority interface.
Since:
3.7
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getReceivedDate

public Date getReceivedDate()
Retrieves the received-date for this message.
Returns:
Date on which this message was received, or the creation date for an outbound message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getRecipients

public Address[] getRecipients(int type)
                        throws MessagingException
Retrieves all the recipient addresses for the message based on recipient type.
Parameters:
type - Type of message recipient (see Message.RecipientType interface; should be Message.RecipientType.TO, Message.RecipientType.CC, or Message.RecipientType.BCC.
Returns:
List of recipient addresses of provided type.
Throws:
MessagingException - To indicate a general messaging error.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getReplyTo

public Address[] getReplyTo()
                     throws MessagingException
Retrieves the addresses to which replies should be directed.

This method retrieves the addresses in this message's Message.RecipientType.REPLY_TO attribute.

Returns:
List of recipient addresses.
Throws:
MessagingException - To indicate a general messaging error.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getSentDate

public Date getSentDate()
Retrieves the sent-date for this message.
Returns:
Date on which this message was sent, or null if no sent-date is available for this message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getSize

public int getSize()
Retrieves the size for this message's content.
Returns:
Size of the contents of the message in bytes, or -1 if it cannot be determined.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getStatus

public int getStatus()
Retrieves the status of this message.
Returns:
Current message status: one of the TX_* or RX_* constants defined in Message.Status.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getSubject

public String getSubject()
Retrieves the subject of this message. Subject string longer than 255 characters will truncated when the message is sent.
Returns:
String appearing in this message's subject line.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getTransmissionError

public int getTransmissionError()
Retrieves the transmission error code for this message.

The transmission error will be 0 unless the message status (returned by getStatus()) is Message.Status.TX_ERROR.

Returns:
Current transmission error code.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

hashCode

public int hashCode()
Retrieves a hash code value for this message.
Overrides:
hashCode in class Object
Since:
JDE 3.6.0
See Also:
Object
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isInbound

public boolean isInbound()
Determines if this message is an inbound (received) message.
Returns:
True if the message is an inbound (received) message; otherwise, false.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isMimeType

public boolean isMimeType(String mimeType)
Determines if this message's content-type matches provided type.

Note: This method compares only the primary-type and sub-type in the content handler.

Parameters:
mimeType - MIME type to which to compare the message; for example, "text/plain".
Returns:
True if the message has the specified MIME type; otherwise, false.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isSet

public boolean isSet(int flag)
Determines if the specified flag is set on this message.
Parameters:
flag - Flag, as defined in Flag.
Returns:
True if the specified flag is set; otherwise, false.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

removeAllRecipients

public boolean removeAllRecipients(int type)
                            throws MessagingException
Removes all the recipients of the type specified.
Parameters:
type - Type should be one of RecipientType.BCC or RecipientType.CC or RecipientType.TO
Returns:
true if successful
Throws:
MessagingException - If the recipient type is not RecipientType.BCC or RecipientType.CC or RecipientType.TO
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

removeHeader

public void removeHeader(String header)
Removes all headers by name.

Note: This method behaves differently depending on the type of header that is being removed. Subject headers are set to null, rather than removed completely from the array. The most noticeable effect of this is that getHeader(String) retrieves an array of strings that have inconsistent lengths.

Parameters:
header - Name of the header fields to remove.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

removeMessageListener

public void removeMessageListener(MessageListener listener)
Removes a message listener from this message.

Note: You should invoke this method only on the message on which addMessageListener(net.rim.blackberry.api.mail.event.MessageListener) was invoked.

Parameters:
listener - Message listener to remove from this message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

removeRecipients

public boolean removeRecipients(int type,
                                Address[] list)
                         throws MessagingException
Removes all the recipients of the type specified from the array of Addresses
Parameters:
type - Type should be one of RecipientType.BCC or RecipientType.CC or RecipientType.TO
list - Array of Addresses
Returns:
true if successful
Throws:
MessagingException - If the recipient type is not RecipientType.BCC or RecipientType.CC or RecipientType.TO
NullPointerException - If the Address array is null
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

reply

public Message reply(boolean replyToAll)
              throws MessagingException
Retrieves a new message object suitable for a reply to this message.
Parameters:
replyToAll - True for reply to all; false for reply to sender only.
Returns:
New message object to send in reply to this message.
Throws:
MessagingException - To indicate a general messaging error.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

reply

public Message reply(boolean replyToAll,
                     boolean replyWithOriginalText)
              throws MessagingException
Retrieves a new message object suitable for a reply to this message.
Parameters:
replyToAll - True for reply to all; false for reply to sender only.
replyWithOriginalText - True to reply with the original text
Returns:
New message object to send in reply to this message.
Throws:
MessagingException - To indicate a general messaging error.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setContent

public void setContent(Object content)
                throws MessagingException
Sets the contents (body) for this message.

Content can be either a String or a Multipart object.

Parameters:
content - Object to server as entire content for this message (any existing body parts are replaced); if null, this method clears this message of all its parts.
Throws:
MessagingException - If an error occurs while creating the message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setFlag

public void setFlag(int flag,
                    boolean set)
Sets or clears the specified flag on this message.
Parameters:
flag - Flag to set or clear for this message.
set - True to set the specified flag, false to clear the flag.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setFlags

public void setFlags(int mask)
Sets flags for this message.
Parameters:
mask - Bitfield of flags to set for the message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setFrom

public void setFrom(Address address)
Sets this message's "From" attribute.
Parameters:
address - "From" (sender) address for this message.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setHeader

public void setHeader(String header,
                      String value)
Sets a value for header by name.

This will overwrite any existing headers matching the specified header name:

  • For TO, BCC, REPLY_TO, FROM and SENDER, a simple email address is expected for value.
  • For DATE, a long date encoded as a string is expected.
Parameters:
header - Name of header to which to add a value.
value - Value to add to named header.
Throws:
IllegalArgumentException - if attempting to set the MESSAGE_ID header
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setInbound

public void setInbound(boolean b)
Sets the message status as an inbound (received) message.
Parameters:
b - True to set status as an inbount message
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setPriority

public void setPriority(byte p)
Sets the priority of the message.
Parameters:
p - Priority to set (one of the Message.Priority interface values).
Since:
3.7
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setReplyTo

public void setReplyTo(Address[] addresses)
Sets the addresses to which replies should be directed.

This method adds addresses to this message's Message.RecipientType.REPLY_TO attribute.

Parameters:
addresses - One or more addresses.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setSentDate

public void setSentDate(Date date)
Sets the sent-date for this message.
Parameters:
date - Date when this message was sent.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setStatus

public void setStatus(int messageStatus,
                      int messageTransmissionError)
Sets the status for this message.

If the message status is Message.Status.TX_ERROR (a transmission error), then the transmission error code in the model will be set to the value of your provided transmission error value. If message status is not Message.Status.TX_ERROR, then the transmission error code in the model will be cleared.

Parameters:
messageStatus - New status for this message.
messageTransmissionError - Transmission error status code to set if the message status is Message.Status.TX_ERROR.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setSubject

public void setSubject(String subject)
Sets the subject for this message. Subject string can have maximum length of 255 characters. Subject string longer than 255 characters will truncated when the message is sent.
Parameters:
subject - String to present in this message's subject line.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

updateUi

public void updateUi()
Initiates any necessary UI updates.

For instnce, if the message is currently open in the message list, this method will cause that view to get updated and hence render any programmatic changes.

Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

writeTo

public void writeTo(OutputStream os)
             throws IOException
Writes this message out as an RFC 822 format stream.
Parameters:
os - Output stream to which to write the message text.
Throws:
IOException - If an error occurs when writing to the outputstream.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.