Message
The Email Message object represents a message on the BlackBerry device. This class can be created and used when launching the new message screen using the invoke API or for direct interaction with the message list storage function.
Supported Platform(s)
- BlackBerry OS 5.0+
- Ripple Emulator
API | OS 5.0 | OS 6.0 | OS 7.0 | PlayBook | Ripple |
---|---|---|---|---|---|
blackberry.message.Message | Y | Y | Y | Y | |
find | Y | Y | Y | Y | |
remove | Y | Y | Y | Y | |
save | Y | Y | Y | Y | |
send | Y | Y | Y | Y | |
bccRecipients | Y | Y | Y | Y | |
body | Y | Y | Y | Y | |
ccRecipients | Y | Y | Y | Y | |
folder | Y | Y | Y | Y | |
from | Y | Y | Y | Y | |
priority | Y | Y | Y | Y | |
replyTo | Y | Y | Y | Y | |
status | Y | Y | Y | Y | |
subject | Y | Y | Y | Y | |
toRecipients | Y | Y | Y | Y | |
uid | Y | Y | Y | Y | |
STATUS_UNKNOWN | Y | Y | Y | Y | |
STATUS_SAVED | Y | Y | Y | Y | |
STATUS_DRAFT | Y | Y | Y | Y | |
STATUS_SENT | Y | Y | Y | Y | |
STATUS_ERROR_OCCURED | Y | Y | Y | Y | |
PRIORITY_HIGH | Y | Y | Y | Y | |
PRIORITY_MEDIUM | Y | Y | Y | Y | |
PRIORITY_LOW | Y | Y | Y | Y | |
FOLDER_INBOX | Y | Y | Y | Y | |
FOLDER_SENT | Y | Y | Y | Y | |
FOLDER_DRAFT | Y | Y | Y | Y | |
FOLDER_OUTBOX | Y | Y | Y | Y | |
FOLDER_DELETED | Y | Y | Y | Y | |
FOLDER_OTHER | Y | Y | Y | Y |
Configuration Document Settings
To use all of the API described for this object, you must ensure the following settings are in your configuration document:
You must declare the feature element(s) below in your configuration document:
Feature ID | OS 5.0 | OS 6.0 | OS 7.0 | PlayBook | Ripple |
---|---|---|---|---|---|
<feature id="blackberry.message" /> | Y | Y | Y | Y | |
<feature id="blackberry.identity" /> | Y | Y | Y | Y | |
<feature id="blackberry.find" /> | Y | Y | Y | Y |
Permission Elements (PlayBook Only) |
---|
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application. |
API Summary
Constructors
Properties
blackberry.message.Message
blackberry.message.Message ([service: blackberry.identity.Service]) |
Supported Platform(s)
- BlackBerry OS 5.0+- Ripple Emulator
Description
The Message object is an instance object, where if a new instance is desired, it must be created using the new keyword.
Parameter | Type | Description |
---|---|---|
service |
blackberry.identity.Service
Optional |
optional parameter that specifies the type of service that is expected. This value can specify the email service to create an email message for. If no parameter is specified the default email service will be used. |
Code Example(s)
<script type="text/javascript"> var message = new blackberry.message.Message(); message.toRecipients = "noone@blackberryWidgets.com"; message.subject = "Hello"; message.body = "World"; message.send(); </script>
find
static Message[] find([filter: blackberry.find.FilterExpression], [maxReturn: Number], [service: blackberry.identity.Service]) |
Supported Platform(s)
- BlackBerry OS 5.0+- Ripple Emulator
Description
This method looks up the messages that matches the expression provided.
Parameter | Type | Description |
---|---|---|
filter |
blackberry.find.FilterExpression
Optional |
optional parameter that defines the search criteria for the find. If no value is provided the method will return all the Messages on the device for the service provided. |
maxReturn |
Number
Optional |
optional integer parameter specifying the maximum number of results to return from the find. If no value is specified, it will return all results found. |
service |
blackberry.identity.Service
Optional |
optional parameter to define which service you wish to search for your messages. If not provided the default service for messages will be used. |
remove
void remove() |
Supported Platform(s)
- BlackBerry OS 5.0+- Ripple Emulator
Description
This method will remove a message from the PIM storage.
save
void save() |
Supported Platform(s)
- BlackBerry OS 5.0+- Ripple Emulator
Description
This method will save the changes made to the message object.
send
void send() |
Supported Platform(s)
- BlackBerry OS 5.0+- Ripple Emulator
Description
This method will send the message to its recipients.
Properties:
Property | Type | Description | Supported Platform(s) |
---|---|---|---|
bccRecipients | String |
Contains a list of the addresses that this message should be bcc'd to; they are delimited by white spaces (for example, space or '\n'), a semicolon, or a comma.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
body | String |
Contains the body of the message.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
ccRecipients | String |
Contains a list of the addresses that this message should be cc'd to; they are delimited by white spaces (for example, space or '\n'), a semicolon, or a comma.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
folder | Number |
Specifies which folder this message is in. This field is read-only. Created messages that are sent are put in the Sent folder. Can be one of the the FOLDER_* constants.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
from |
String
readonly |
Contains the address that this message is sent from. This field is read-only; it is automatically filled in for created messages once they are sent.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
priority | Number |
Specifies the priority of the message. Can be one of the PRIORITY_* constants.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
replyTo |
String
readonly |
Contains the address that the reply to this message should be sent to.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
status |
Number
readonly |
Specifies the status of the message. Can be one of the STATUS_* constants.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
subject | String |
Contains the subject of the message.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
toRecipients | String |
Contains a list of the addresses that this message should be sent to. The list of addresses is delimited by white spaces (for example, space or '\n'), a semicolon, or a comma.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
uid |
Number
readonly |
Contains the unique identifier for this message.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
Constants:
Property | Type | Description | Supported Platform(s) |
---|---|---|---|
STATUS_UNKNOWN | Number |
Constant representing the UNKNOWN status. The current status cannot be determined.
|
- BlackBerry OS 5.0+
- Ripple Emulator |
STATUS_SAVED | Number |
Constant representing the SAVED status
|
- BlackBerry OS 5.0+
- Ripple Emulator |
STATUS_DRAFT | Number |
Constant representing the DRAFT status
|
- BlackBerry OS 5.0+
- Ripple Emulator |
STATUS_SENT | Number |
Constant representing the SENT status
|
- BlackBerry OS 5.0+
- Ripple Emulator |
STATUS_ERROR_OCCURED | Number |
Constant representing the ERROR status
|
- BlackBerry OS 5.0+
- Ripple Emulator |
PRIORITY_HIGH | Number |
Constant representing a HIGH priority
|
- BlackBerry OS 5.0+
- Ripple Emulator |
PRIORITY_MEDIUM | Number |
Constant representing a MEDIUM priority
|
- BlackBerry OS 5.0+
- Ripple Emulator |
PRIORITY_LOW | Number |
Constant representing a LOW priority
|
- BlackBerry OS 5.0+
- Ripple Emulator |
FOLDER_INBOX | Number |
Constant representing the INBOX folder
|
- BlackBerry OS 5.0+
- Ripple Emulator |
FOLDER_SENT | Number |
Constant representing the SENT folder
|
- BlackBerry OS 5.0+
- Ripple Emulator |
FOLDER_DRAFT | Number |
Constant representing the DRAFT folder
|
- BlackBerry OS 5.0+
- Ripple Emulator |
FOLDER_OUTBOX | Number |
Constant representing the OUTBOX folder
|
- BlackBerry OS 5.0+
- Ripple Emulator |
FOLDER_DELETED | Number |
Constant representing the DELETED folder
|
- BlackBerry OS 5.0+
- Ripple Emulator |
FOLDER_OTHER | Number |
Constant representing an OTHER folder
|
- BlackBerry OS 5.0+
- Ripple Emulator |