Bondi logo

The Bondi Messaging Module: bondi.messaging - Version 1.0

28 May 2009

Authors


Abstract

To access the email, sms and messaging functions of the phone The BONDI messaging API provides access to the messaging device system. With this API, messages (SMS,MMS,EMAIL) can be created and sent. The following methods are used to create messages: All these methods return a specific message object, the object type depends on the method used to create it. -createSMS() - returns an SMS object. -createMMS() - returns an MMS object. -createEmail() - returns an Email object. Each of these methods accepts the object properties as an input parameter in the form of a map. The keys supported are returned by the getxxxSupportedPropertyKey provided by the Communications Log API

Table of Contents


Summary of Methods

InterfaceMethod
MessagingErrorCallbackvoid onError(MessagingError error)
MessagingError
MessagingManagerSMSMessage createSMS(SmsObject smsParams)
MMSMessage createMMS(MmsObject mmsParams)
EmailMessage createEmail(EmailObject emailParams)
PendingOperation sendSMS(SuccessCallback successCallback, MessagingErrorCallback errorCallback, SMSMessage sms)
PendingOperation sendMMS(SuccessCallback successCallback, MessagingErrorCallback errorCallback, MMSMessage mms)
PendingOperation sendEmail(SuccessCallback successCallback, MessagingErrorCallback errorCallback, EmailMessage email)
PendingOperation getAvailableEmailAccounts(SuccessCallback successCallback, ErrorCallback errorCallback)
SMSMessageObject getProperty(DOMString propertyName)
void setProperty(DOMString propertyName, DOMString propertyValue)
StringArray getRecipients()
DOMString getRecipient(unsigned short index)
void appendRecipient(DOMString phoneNumber)
void clearRecipients()
MMSSlide
MMSMessageObject getProperty(DOMString propertyName)
void setProperty(DOMString propertyName, Object propertyValue)
StringArray getRecipients()
DOMString getRecipient(unsigned long index)
void appendRecipient(DOMString phoneNumber)
void clearRecipients()
FileArray getAttachments()
File getAttachment(unsigned short index)
void appendAttachment(File myAttachment)
void clearAttachments()
EmailMessageDOMString getProperty(DOMString propertyName)
void setProperty(DOMString propertyName, DOMString propertyValue)
StringArray getToList()
DOMString getTo(unsigned short index)
StringArray getCCList()
DOMString getCC(unsigned short index)
StringArray getBCCList()
DOMString getBCC(unsigned short index)
void appendTo(DOMString emailAddress)
void clearTo()
void appendCC(DOMString emailAddress)
void clearCC()
void appendBCC(DOMString emailAddress)
void clearBCC()
FileArray getAttachments()
File getAttachment(unsigned short index)
void appendAttachment(File myAttachment)
void clearAttachments()

1. Introduction

This API provides the functionality to send messages already created by the methods explained above. The following methods are used to send messages: -sendSMS() -sendMMS() -sendEmail()

The Messaging API exposes classes to manage the messaging objects (SMS,MMS,EMAIL). Multiple recipients can be added to the messages using the appendRecipient method. With the MMS and EMAIL you can attach files using the appendAttachment() method.

1.1. Features

This is the list of URIs used to declare this API's features, for use in bondi.requestFeature. For each URL, the list of functions provided is provided.

http://bondi.omtp.org/api/messaging.email.send

Call to the sendEmail in the messagingManager

Device capabilities: messaging.email.send

http://bondi.omtp.org/api/messaging.mms.send

Call to the sendMMS in the messagingManager

Device capabilities: messaging.mms.send

http://bondi.omtp.org/api/messaging.sms.send

Call to the sendSMS method in the messagingManager

Device capabilities: messaging.sms.send

http://bondi.omtp.org/api/messaging.email.getAccounts

Call to the getAvailableEmailAccounts method in the messagingManager

Device capabilities: messaging.email.getAccounts

http://bondi.omtp.org/api/messaging.email.attach

Call to the appendAttachments in the email object

Device capabilities: messaging.email.attach

http://bondi.omtp.org/api/messaging.mms.attach

Call to the appendAttachments in the mms object

Device capabilities: messaging.mms.attach

1.2. Device capabilities

messaging.email.attach

Add/change attachment on an email

messaging.mms.attach

Add/change attachment on an MMS

messaging.email.getAccounts

Get email accounts

messaging.email.send

Sends an email message

Security parameters:

  • recipients: Space-separated list of recipient email addresses.
  • inContacts: yes or undefined value depending on whether all recipients are in contacts list
messaging.mms.send

Sends an mms message

Security parameters:

  • recipients: Space-separated list of recipient phone numbers. Any international phone number must start with a U+002B PLUS SIGN.
  • inContacts: yes or undefined value depending on whether all recipients are in contacts list
messaging.sms.send

Sends an sms message

Security parameters:

  • recipients: Space-separated list of recipient phone numbers. Any international phone number must start with a U+002B PLUS SIGN.
  • inContacts: yes or undefined value depending on whether all recipients are in contacts list

2. Type Definitions

2.1. MMSSlidesArray

Array of slides

        typedef sequence<MMSSlide> MMSSlidesArray;

3. Interfaces

3.1. MessagingErrorCallback

The messaging API specific error callback.

        [Callback] interface MessagingErrorCallback {
                void onError(in MessagingError error);
        };

This error callback defines the interface to use for all asynchronous methods of the messaging API which are using error callbacks. The callback is invoked with a MessagingError object that describes the ocurred error.

3.2. MessagingError

Messaging Errors

        interface MessagingError : DeviceAPIError {

                const unsigned short OUT_OF_COVERAGE_ERROR = 1;

                const unsigned short MMS_VIDEO_SLIDE_ERROR = 2;

                const unsigned short MMS_MESSAGE_SIZE_EXCEEDED_ERROR = 3;
        };

This interface inherits from: DeviceAPIError

Constants

unsigned short OUT_OF_COVERAGE_ERROR

There is no coverage

unsigned short MMS_VIDEO_SLIDE_ERROR

Media addition is not possible, since the slide already includes a media file that cannot coexist with the others.

unsigned short MMS_MESSAGE_SIZE_EXCEEDED_ERROR

Message size would be exceeded by the given operation.

3.3. MessagingManager

class for managing all messaging functions

        interface MessagingManager {

                const unsigned short INBOX_FOLDER = 0;

                const unsigned short OUTBOX_FOLDER = 1;

                const unsigned short SENT_FOLDER = 2;

                const unsigned short DRAFTS_FOLDER = 3;

                SMSMessage createSMS([Optional] in SmsObject smsParams)
                        raises(DeviceAPIError);

                MMSMessage createMMS([Optional] in MmsObject mmsParams)
                        raises(DeviceAPIError);

                EmailMessage createEmail([Optional] in EmailObject emailParams)
                        raises(DeviceAPIError);

                PendingOperation sendSMS(in SuccessCallback successCallback,
                                              in MessagingErrorCallback errorCallback,
                                              in SMSMessage sms)
                        raises(SecurityError, DeviceAPIError, MessagingError);

                PendingOperation sendMMS(in SuccessCallback successCallback,
                                              in MessagingErrorCallback errorCallback,
                                              in MMSMessage mms)
                        raises(SecurityError, DeviceAPIError, MessagingError);

                PendingOperation sendEmail(in SuccessCallback successCallback,
                                                in MessagingErrorCallback errorCallback,
                                                in EmailMessage email)
                        raises(SecurityError, DeviceAPIError, MessagingError);

                PendingOperation getAvailableEmailAccounts(in SuccessCallback successCallback,
                                                                in ErrorCallback errorCallback)
                        raises(SecurityError, DeviceAPIError);
        };

The messaging manager interface provides methods to create and send messages.

Code example
        bondi.requestFeature(successCB, errorCB, "messaging");
 

Constants

unsigned short INBOX_FOLDER

Constant used to identify the INBOX folder.

unsigned short OUTBOX_FOLDER

Constant used to identify the OUTBOX folder.

unsigned short SENT_FOLDER

Constant used to identify the SENT folder.

unsigned short DRAFTS_FOLDER

Constant used to identify the DRAFTS folder.

Methods

createSMS

Creation of an SMS object

Signature
SMSMessage createSMS(SmsObject smsParams);

Creates an SMS object and stores it in the Drafts folder.

Parameters
  • smsParams: Associative Array containing the information to create the sms. Supported keys are returned by getSMSSupportedPropertyKeys. Common properties and associated syntax are:
    body: String. This represents the body of the sms
    recipients: String. Semicolom(;) separated string containing the recipients list
    store: Boolean. Indicates if the sms will be stored in the sent messages folder. True -> Stored
Return value
SMS object.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if smsParams does not follow the correct format described above.
Code example
        //This method creates a message in the Drafts folder with the values passed as parameters
        bondi.messaging.createSMS({recipients:"+34666666666",body:"Hello from Huesca",store:false});
createMMS

Creates an MMS object and stores it in the Drafts folder.

Signature
MMSMessage createMMS(MmsObject mmsParams);
Parameters
  • mmsParams: Associative array containing the information to create the mms. Supported keys are returned by getMMSSupportedPropertyKeys. Common properties and associated syntax are:
    body: String. This represents the body of the mms as defined in
    http://www.openmobilealliance.org/Technical/release_program/docs/MMS/V1_3-20080128-C/OMA-TS-MMS-CONF-V1_3-20080128-C.pdf
    recipients: String. Semicolom(;) separated string containing the recipients' addresses as defined in TS23140, section 7.2.1, i.e.
    RFC 2822 address (FQDN or unqualified)
    or
    PLMN address: [ "+" | "*" | "#" ] [digit | "*" | "#" ] ... ["/TYPE=PLMN"]
    store: Boolean. Indicates if the mms will be stored in the sent messages folder. True -> Stored
    attachments: File. It's the file attached to the mms.
Return value
MMS object.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if mmsParams does not follow the correct format described above.
Code example
        var files=getFiles();
        var mms =bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:false});
 
createEmail

Creates an Email object and stores it in the Drafts folder.

Signature
EmailMessage createEmail(EmailObject emailParams);


Supported Associative Array keys are returned by the getEmailSupportedPropertyKeys. Common properties and associated syntax are:
from: String. The address used to send the email. It must be configured on the default messaging application of the phone. Addresses should be of the format defined in RFC 5322 3.4
to: String. Semicolom(;) separated string containing the recipients list. Addresses should be of the format defined in RFC 5322 3.4
cc: String. Semicolom(;) separated string containing the cc recipients list. Addresses should be of the format defined in RFC 5322 3.4
bcc: String. Semicolom(;) separated string containing the bcc recipients list. Addresses should be of the format defined in RFC 5322 3.4
subject: String. Resume of the email content in the format defined in RFC 5322 2.2
body: String. Email text in the format defined in RFC 5322 2.3
attachments: File. It's the file attached to the email.
store: Boolean. Indicates if the mms will be stored in the sent messages folder. True -> Stored

Parameters
  • emailParams: Associative array containing the information to create the email. The order within the associative array is the following: from, to, cc, bcc, subject, body, attachments and store.
Return value
Email object.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if emailParams does not follow the correct format described above.
Code example
        var files = getFiles();
        var myEmail = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:false});
 
sendSMS

Sends an SMS This method sends an SMS object that has been created in Drafts folder. When the message has been sent it is stored in the Sent message folder (if the store property is true). It is an asynchronous method. The success method is executed when the sms has been marked to be sent and stored in the Outgoing messaging folders. After this the OS is forced to sync mail folders.

Signature
PendingOperation sendSMS(SuccessCallback successCallback, MessagingErrorCallback errorCallback, SMSMessage sms);
Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • sms: an SMSMessage object containing the message to be sent
Return value
PendingOperation enabling the requester to cancel this request.
Exceptions
  • SecurityError: PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
  • MessagingError: OUT_OF_COVERAGE_ERROR when the device is out of network coverage
API features
http://bondi.omtp.org/api/messaging.sms.send
Code example
        //This method creates a messaging in the Drafts folder with the values passed as parameters
        var sms = bondi.messaging.createSMS({body:"Just arrived in Huesca",recipients:"+34666666666"});
        //This method sends the prevoius created message
        bondi.messaging.sendSMS(successCallback, errorCallback,sms);

        function successCallback(response) {
                alert("Sent");
        }

        function errorCallback(response) {
                alert( "The following error code: " +  response.code);
        }
 
sendMMS

Sends an MMS

Signature
PendingOperation sendMMS(SuccessCallback successCallback, MessagingErrorCallback errorCallback, MMSMessage mms);

This method sends an MMS object that has been created in the Drafts folder. When the message has been sent it is stored in the Sent message folder (if the store property is true). It is an asynchronous method. The success method is executed when the mms has been marked to be sent and stored in the Outgoing messaging folders. After this the OS is forced to sync mail folders.

Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • mms: an MMSMessage object containing the message to be sent
Return value
PendingOperation enabling the requester to cancel this request.
Exceptions
  • SecurityError: PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
  • MessagingError: OUT_OF_COVERAGE_ERROR when the device is out of network coverage
API features
http://bondi.omtp.org/api/messaging.mms.send
Code example
        var mms = bondi.messaging.createMMS(null);
        mms.setProperty("body", "Just arrived today at...");
        mms.subject = "In Huesca!";
        mms.appendRecipient ("+34666666666");
        bondi.messaging.sendMMS(successCallback, errorCallback,mms);

        function successCallback(response) {
                alert("Sent");
        }

        function errorCallback(response) {
                alert( "The following error code: " +  response.code);
        }
 
sendEmail

Sends and e-mail

Signature
PendingOperation sendEmail(SuccessCallback successCallback, MessagingErrorCallback errorCallback, EmailMessage email);

This method sends an Email object that has been created in the Drafts folder. When the message has been sent it is stored in the Sent message folder (if the store property is true). It is an asynchronous method. The success method is executed when the mms has been marked to be sent and stored in the Outgoing messaging folders. After this the OS is forced to sync mail folders.

Parameters
  • successCallback: function called when the invocation ends successfully.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
  • email: an EmailMessage object containing the message to be sent
Return value
PendingOperation enabling the requester to cancel this request.
Exceptions
  • SecurityError: PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
  • MessagingError: OUT_OF_COVERAGE_ERROR when the device is out of network coverage
API features
http://bondi.omtp.org/api/messaging.email.send
Code example
        var email = bondi.messaging.createEmail();
        email.setProperty("body", "Just arrived today at...");
        email.subject = "In Huesca!";
        email.appendTo("ester@vodafone.com");
        me.sendEmail(successCallback, errorCallback,email);

        function successCallback(response) {
                alert("Sent");
        }

        function errorCallback(response) {
                alert( "The following error code: " +  response.code);
        }
 
getAvailableEmailAccounts

Signature
PendingOperation getAvailableEmailAccounts(SuccessCallback successCallback, ErrorCallback errorCallback);

This method gets available email accounts that can be used (to be included in the From field). These addresses are separated by semicoloms(";"). This is an asyncronous method. Returns null if no email accounts are configured in the terminal.

Parameters
  • successCallback: function called when the invocation ends successfully, use response object to retrieve the array of Strings containing accounts.
  • errorCallback: function called when an error occurs, the input parameter "response" is an Error object with string properties "name" and "message" giving information about the type of error that occurred.
Return value
PendingOperation enabling the requester to cancel this request.
Exceptions
  • SecurityError: PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
API features
http://bondi.omtp.org/api/messaging.email.getAccounts
Code example
        var accounts = bondi.messaging.getAvailableEmailAccounts(successCallback, errorCallback, null);

        function successCallback(response) {
                var email = bondi.messaging.createEmail({from:response[0]});
        }

        function errorCallback(response) {
                alert( "The following error code: " +  response.code);
        }
 

3.4. SMSMessage

SMS Message API

        interface SMSMessage {

                Object getProperty(in DOMString propertyName)
                        raises(DeviceAPIError);

                void setProperty(in DOMString propertyName, in DOMString propertyValue)
                        raises(DeviceAPIError);

                readonly attribute DOMString id;

                readonly attribute Date datetime;

                 attribute DOMString body
                        setraises(DeviceAPIError);

                 attribute boolean store
                        setraises(DeviceAPIError);

                readonly attribute unsigned short folder;

                readonly attribute boolean read;

                StringArray getRecipients();

                DOMString getRecipient(in unsigned short index)
                        raises(DeviceAPIError);

                void appendRecipient(in DOMString phoneNumber)
                        raises(DeviceAPIError);

                void clearRecipients()
                        raises(DeviceAPIError);
        };

The SMS Message interface provides methods to populate and send a message.

Code example
        bondi.requestFeature(successCB, errorCB, "bondi.messaging");
 

Attributes

[readonly] DOMString id

Integer that contains the unique identifier assigned to the message in the platform.

This is a readonly property

Code example
        var sms = bondi.messaging.createSMS();
        var id = sms.id;
 
[readonly] Date datetime

Object that contains the datetime where the sms was sent or received or created in draft, depending the storage folder.

Code example
        var sms = bondi.messaging.createSMS(null);
        var dateTime = sms.datetime;
 
DOMString body

String that contains the body of the SMS.

Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if invalid value is given to body
Code example
        var sms = bondi.messaging.createSMS({recipients:"+34666666666",body:"Hello from Huesca",store:false});
        ...
        alert(sms.body);
 
boolean store

Boolean that indicates whether the message is going to be stored in the SENT folder once sent.

Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if invalid store value is given
Code example
        var sms =bondi.messaging.createSMS({recipients:"+34666666666",body:"Hello from Huesca",store:false});
        ...
        alert(sms.store);
 
[readonly] unsigned short folder

Integer that indicates the folder in which the message is stored.

T

Code example
        var sms = bondi.messaging.createSMS({recipients:"+34666666666",body:"Hello from Huesca",store:false});
        alert(sms.folder);
 
[readonly] boolean read

Value that indicates if the message has been already read

Code example
        var sms = bondi.messaging.createSMS(null);
        var isRead = sms.read;
 

Methods

getProperty

Returns the value of any of the SMS message object properties.

Signature
Object getProperty(DOMString propertyName);

Supported properties
body: String. This represents the body of the sms
recipients: String. Semicolom(;) separated string containing the recipients list
store: Boolean. Indicates if the sms will be stored in the sent messages folder. True -> Stored
id: Integer. Identificator of the SMS
read: Boolean. It indicates if the SMS has been readen (true) or not (false).
folder: Integer. It indicates the folder where the sms is stored (must be one of INBOX_FOLDER, OUTBOX_FOLDER, SENT_FOLDER, DRAFTS_FOLDER defined in MessagingManager).
dateTime: Date. Date object with info about the sms creation or reception date.

Parameters
  • propertyName: DOMString containing the name of the property to be queried.
Return value
Int containing the value of that property when property is id or folder. Date containing the value of that property when property is dateTime. Boolean containing the value of that property when properties are store or read. Object containing the value of that property when properties are body or recipients.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
Code example
        var sms = bondi.messaging.createSMS();
  sms.folder = bondi.messaging.DRAFTS_FOLDER;
        sms.body="Hello!!";
        var body = sms.getProperty("body");
 
setProperty

n Sets the value of any of the SMS message object properties. (body, store).

Signature
void setProperty(DOMString propertyName, DOMString propertyValue);
Parameters
  • propertyName: DOMString containing the name of the property to be set.
  • propertyValue: DOMString ('body') or Boolean ('store') containing the value of the property to be set.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter is provided to this function
Code example
        var sms = bondi.messaging.createSMS();
        sms.setProperty("body", "Just arrived in Huesca");
 
getRecipients

This method returns the list of recipients added to the SMS

Signature
StringArray getRecipients();
Return value
Array of String containing each one of the recipients for this message (telephone numbers).
Code example
        var sms =  bondi.messaging.createSMS({recipients:"+34666666666",body:"Hello from Huesca",store:true});
        var recipients = sms.getRecipients();
        alert(recipients.count + " recipients";
 
getRecipient

Gets a recipient from the list of recipients.

Signature
DOMString getRecipient(unsigned short index);
Parameters
  • index: an integer pointing the position of the recipient to be retrieved.
Return value
a DOMString containing the telephone number (telephone numbers).
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var sms = bondi.messaging.createSMS({recipients:"+34666666666",body:"Hello from Huesca",store:true});
        alert(sms.getRecipient(0));
 
appendRecipient

Adds (appends) a new recipient to the list. This recipient must be a phone number format.

Signature
void appendRecipient(DOMString phoneNumber);
Parameters
  • phoneNumber: a DOMString containing the phone number of the recipient to be added.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided (e.g. if the parameter provided represents an invalid destination or if the phone number provided is larger than the max available size
Code example
        var sms = bondi.messaging.createSMS(null);
        sms.appendRecipient("+34666666666");
 
clearRecipients

Removes the entire recipients list.

Signature
void clearRecipients();
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var sms = bondi.messaging.createSMS({recipients:"+34666666666",body:"Hello from Huesca",store:true});
        sms.clearRecipients();
 

3.5. MMSSlide

MMS Slide is a triplet of an image, audio and text. Optionally it can include a video as a replacement for image and audio.

        interface MMSSlide {

                attribute unsigned long duration;

                attribute File image
                        setraises(MessagingError);

                attribute unsigned long imageBegin;

                attribute unsigned long imageEnd;

                attribute File audio
                        setraises(MessagingError);

                attribute unsigned long audioBegin;

                attribute unsigned long audioEnd;

                attribute DOMString text
                        setraises(MessagingError);

                attribute unsigned long textBegin;

                attribute unsigned long textEnd;

                attribute File video
                        setraises(MessagingError);

                attribute unsigned long videoBegin;

                attribute unsigned long videoEnd;
        };

http://www.openmobilealliance.org/Technical/release_program/docs/MMS/V1_3-20080128-C/OMA-TS-MMS-CONF-V1_3-20080128-C.pdf section 8: "A slide that contains video SHALL contain only video and text components."

Attributes

unsigned long duration

Duration of the slide presentation, in milliseconds.

File image

Image

File containing the image

Exceptions
  • MessagingError: MMS_MESSAGE_SIZE_EXCEEDED if the message size would be exceeded by the adding operation MMS_VIDEO_SLIDE_ERROR if the slide already includes video part.
unsigned long imageBegin

Beginning of image presentation within a slide, in milliseconds.

unsigned long imageEnd

End of image presentation within a slide, in milliseconds.

File audio

Audio

File containing the audio

Exceptions
  • MessagingError: MMS_MESSAGE_SIZE_EXCEEDED if the message size would be exceeded by the adding operation MMS_VIDEO_SLIDE_ERROR if the slide already includes video part.
unsigned long audioBegin

Beginning of audio playback within a slide, in milliseconds.

unsigned long audioEnd

End of audio playback within a slide, in milliseconds.

DOMString text

Audio

Exceptions
  • MessagingError: MMS_MESSAGE_SIZE_EXCEEDED if the message size would be exceeded by the adding operation
unsigned long textBegin

Beginning of text presentation within a slide, in milliseconds.

unsigned long textEnd

End of text presentation within a slide, in milliseconds.

File video

Video

File containing the video

Exceptions
  • MessagingError: MMS_MESSAGE_SIZE_EXCEEDED if the message size would be exceeded by the adding operation MMS_VIDEO_SLIDE_ERROR if the slide already includes image or audio part.
unsigned long videoBegin

Beginning of video presentation within a slide, in milliseconds.

unsigned long videoEnd

End of video presentation within a slide, in milliseconds.

3.6. MMSMessage

MMS Message API

        interface MMSMessage {

                Object getProperty(in DOMString propertyName)
                        raises(DeviceAPIError);


                void setProperty(in DOMString propertyName, in Object propertyValue)
                        raises(DeviceAPIError);

                readonly attribute DOMString id;

                readonly attribute Date datetime;

                attribute DOMString multipartMixedBody
                        setraises(DeviceAPIError);

                attribute boolean store
                        setraises(DeviceAPIError);

                readonly attribute unsigned long folder;

                attribute DOMString subject
                        setraises(DeviceAPIError);

                readonly attribute boolean read;

                StringArray getRecipients();

                DOMString getRecipient(in unsigned long index)
                        raises(DeviceAPIError);

                void appendRecipient(in DOMString phoneNumber)
                        raises(DeviceAPIError);

                void clearRecipients()
                        raises(DeviceAPIError);


                FileArray getAttachments()
                        raises(DeviceAPIError);

                File getAttachment(in unsigned short index)
                        raises(DeviceAPIError);


                void appendAttachment(in File myAttachment)
                        raises(SecurityError, DeviceAPIError);

        
                void clearAttachments()
                        raises(DeviceAPIError);

                const unsigned short MULTIPART_MIXED = 0;

                const unsigned short MULTIPART_RELATED = 1;

                attribute unsigned short messageType;

                attribute MMSSlideArray slides;
        };

The MMS Message interface provides methods to populate and send a multimedia message.

Code example
        bondi.requestFeature('bondi.messaging', { id: 'messaging',successCallback: successFunc,errorCallback: failureFunc } );
 

Constants

unsigned short MULTIPART_MIXED

Constant used to identify the type of MMS Message as multipart/mixed.

Constant used to identify the type of MMS Message as multipart/related.

Attributes

[readonly] DOMString id

Unique identifier assigned to the message in the platform.

Code example
        var MMS = bondi.messaging.createMMS(null);
        var id = MMS.id;
 
[readonly] Date datetime

String that contains the datetime where the MMS was sent or received or created in draft, depending the storage folder.

Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var MMS = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:false});
        var dateTime = MMS.datetime;
 
DOMString multipartMixedBody

String that contains the multipart/mixed message body.

Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid value is given to the body
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var MMS = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:false});
        alert(MMS.body);
 
boolean store

Property that indicates whether the message is going to be stored in the SENT folder once sent.

Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid value is given to the store (eg: not boolean).
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var MMS = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        alert(MMS.store);
 
[readonly] unsigned long folder

Folder where the message is stored.

This value will be one of INBOX_FOLDER, OUTBOX_FOLDER, SENT_FOLDER, DRAFTS_FOLDER defined in MessagingManager.

Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
  // Create the message in the Drafts folder.
        var MMS = bondi.messaging.createMMS({folder: bondi.messaging.DRAFTS_FOLDER, recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        alert(MMS.folder);
 
DOMString subject

String with the subject of the MMS

Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid value is given to the subject
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var mms = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        alert(mms.subject);
 
[readonly] boolean read

Value that indicates if the message has been already read

Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var mms = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        var isRead = mms.read;
 
unsigned short messageType

Type of message: multipart/mixed or multipart/related

MMSSlideArray slides

Actual slides

Methods

getProperty

Returns the value of any of the MMS message object properties.

Signature
Object getProperty(DOMString propertyName);

Supported properties
body: String. This represents the body of the multipart/mixed mms
subject: String. This represents a resume of the mms
recipients: String. Semicolom(;) separated string containing the recipients list
store: Boolean. Indicates if the mms will be stored in the sent messages folder. True -> Stored
id: Integer. Identificator of the MMS
read: Boolean. It indicates if the MMS has been readen (true) or not (false).
folder: Integer. It indicates the folder where the mms is stored.
datetime: Date. Date object with info about the mms creation or reception date.
attachment: File. File object with info about the mms attachment.

Parameters
  • propertyName: DOMString containing the name of the property to be queried.
Return value
Boolean containing the value of that property (store, read) integer containing the value of that property ( folder) Date containing the value of the creation or reception date of the MMS (datetime). File containing the value of that property (attachment). DOMString containing the value of that property (body,recipients,id).
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var mms =bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:false});
        var body = mms.getProperty("body");
 
setProperty

Sets the value of any of the MMS message object properties. (body, subject, store, attachment, recipients).

Signature
void setProperty(DOMString propertyName, Object propertyValue);
Parameters
  • propertyName: DOMString containing the name of the property to be set.
  • propertyValue: DOMString (body, subject, recipients), Boolean (store), File (attachment) containing the value of the property to be set.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid property is introduced like a param INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var MMS = bondi.messaging.createMMS(null);
        MMS.setProperty("body", "Just arrived in Huesca");
 
getRecipients

Gets the list of recipients added to this message.

Signature
StringArray getRecipients();
Return value
StringArray of String containing each one of the recipients for this message (telephone numbers).
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var MMS = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        var recipients = MMS.getRecipients();
        alert(recipients.count + " recipients";
 
getRecipient

Gets a recipient from the list of recienpients.

Signature
DOMString getRecipient(unsigned long index);
Parameters
  • index: an unsigned long integer pointing the position of the recipient to be retrieved.
Return value
DOMString containing the telephone number (telephone numbers).
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided (e.g. the requested recipient index is out of bounds
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var MMS = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        alert(MMS.getRecipient(0));
 
appendRecipient

Adds (appends) a new recipient to the list.

Signature
void appendRecipient(DOMString phoneNumber);
Parameters
  • phoneNumber: a DOMString containing the phone number of the recipient to be added.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided (e.g. if the parameter provided represents an invalid destination or if the phone number provided is larger than the max available size
Code example
        var MMS = bondi.messaging.createMMS(null);
        MMS.appendRecipient("+34666666666");
 
clearRecipients

Removes the entire recipients list

Signature
void clearRecipients();
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var MMS = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        MMS.clearRecipients();
 
getAttachments

Gets the list of attachments added to this message.

Signature
FileArray getAttachments();
Return value
FileArray an array of files containing the path for each one of the files attached concatenated with the mime type and separated by ;.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var mms = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        var attachments = getAttachments();
        alert(attachments[0]);
 
getAttachment

Gets an attachment from the list of added attachments.

Signature
File getAttachment(unsigned short index);
Parameters
  • index: an integer pointing to the position of the attachment to be retrieved.
Return value
DOMString containing the path for the file attached concatenated with the mime type and separated by ;.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided (e.g. the requested recipient index is out of bounds)
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var mms = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        alert(getAttachment(0));
 
appendAttachment

Adds a file to the attachment list of the message.

Signature
void appendAttachment(File myAttachment);
Parameters
  • myAttachment: a String containing the path of the file to be attached.
Exceptions
  • SecurityError: PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
API features
http://bondi.omtp.org/api/messaging.mms.attach
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var mms = bondi.messaging.createMMS();
        mms.appendAttachment(files);
 
clearAttachments

Removes the entire attachments list

Signature
void clearAttachments();
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var mms = bondi.messaging.createMMS({recipients:"+34666666666", subject:"Hello from Huesca", body:"How Are You?", attachments:files, store:true});
        mms.clearAttachments();
 

3.7. EmailMessage

Email Message API

        interface EmailMessage {

                DOMString getProperty(in DOMString propertyName)
                        raises(DeviceAPIError);

                

                void setProperty(in DOMString propertyName, in DOMString propertyValue)
                        raises(DeviceAPIError);

                readonly attribute DOMString id;

                readonly attribute Date datetime;

                attribute DOMString from
                        setraises(DeviceAPIError);

                StringArray getToList()
                        raises(DeviceAPIError);

                DOMString getTo(in unsigned short index)
                        raises(DeviceAPIError);

                StringArray getCCList()
                        raises(DeviceAPIError);

                DOMString getCC(in unsigned short index)
                        raises(DeviceAPIError);

                StringArray getBCCList();

                DOMString getBCC(in unsigned short index)
                        raises(DeviceAPIError);

                 attribute DOMString body
                        setraises(DeviceAPIError);

                attribute boolean store
                        setraises(DeviceAPIError);

                readonly attribute unsigned short folder;

                attribute DOMString subject
                        setraises(DeviceAPIError);

                readonly attribute boolean read;

                void appendTo(in DOMString emailAddress)
                        raises(DeviceAPIError);


                void clearTo()
                        raises(DeviceAPIError);

                void appendCC(in DOMString emailAddress)
                        raises(DeviceAPIError);



                void clearCC()
                        raises(DeviceAPIError);

                void appendBCC(in DOMString emailAddress)
                        raises(DeviceAPIError);

                void clearBCC()
                        raises(DeviceAPIError);

                FileArray getAttachments()
                        raises(DeviceAPIError);

                File getAttachment(in unsigned short index)
                        raises(DeviceAPIError);


                void appendAttachment(in File myAttachment)
                        raises(SecurityError, DeviceAPIError);

                void clearAttachments()
                        raises(DeviceAPIError);
        };

The Email Message interface provides methods to populate and send an email message.

Code example
         bondi.requestFeature('bondi.messaging', { id: 'messaging',successCallback: successFunc,errorCallback: failureFunc } );
 

Attributes

[readonly] DOMString id

Unique identifier assigned to the message in the platform.

Code example
        var email = bondi.messaging.createEmail(null);
        var id = email.id;
 
[readonly] Date datetime

String that contains the datetime where the Email was sent or received or created in draft, depending the storage folder.

Code example
        var email = bondi.messaging.createEmail(null);
        var dateTime = email.datetime;
 
DOMString from

Email account that is being used to send the message.

Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if the value isn't an email address
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:true});
        var account = email.from;
 
DOMString body

Gets the body of the email

Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if body value isn't a string
Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        alert(email.body);
 
boolean store

Property that indicates whether the message is going to be stored in the SENT folder once sent.

Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if store value isn't a boolean
Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        alert(email.store);
 
[readonly] unsigned short folder

Folder where the message is stored.

This attribute will be one of INBOX_FOLDER, OUTBOX_FOLDER, SENT_FOLDER, DRAFTS_FOLDER defined in MessagingManager.

Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        alert(email.folder);
 
DOMString subject

Message subject.

Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if subject value isn't a string
Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        alert(email.subject);
 
[readonly] boolean read

Value that indicates if the message has already been read

Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        var isRead = email.read;
 

Methods

getProperty

Gets the value of the Email message object properties.

Signature
DOMString getProperty(DOMString propertyName);


Supported properties
from: String. It's the address used to send the email. It must be configured on the default messaging application of the phone. Addresses look like xxx@yyy.zzz
recipients: String. Semicolom(;) separated string containing the recipients list. Addresses look like xxx@yyy.zzz
cc: String. Semicolom(;) separated string containing the cc recipients list. Addresses look like xxx@yyy.zzz
bcc: String. Semicolom(;) separated string containing the bcc recipients list. Addresses look like xxx@yyy.zzz
subject: String. Resume of the email content.
body: String. Email text.
store: Boolean. Indicates if the email will be stored in the sent messages folder. True -> Stored
read: Boolean. Indicates if the email has been readen(true) or not(false)
id: String. Identification of the email
datetime: Date object which stores the date when the email was created
folder: Integer. It indicates the folder where the email is stored (must be one of INBOX_FOLDER, OUTBOX_FOLDER, SENT_FOLDER, DRAFTS_FOLDER defined in MessagingManager).

Parameters
  • propertyName: DOMString containing the name of the property to be queried.
Return value
DOMString containing the value of that property.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid property is introduced like a param. INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:true});
        var body = email.getProperty("body");
 
setProperty

Sets the value of any of the Email message object properties.

Signature
void setProperty(DOMString propertyName, DOMString propertyValue);
Parameters
  • propertyName: DOMString containing the name of the property to be set.
  • propertyValue: DOMString (recipients, cc, bcc, subject, body, from) or Boolean (store)containing the value of the property to be set.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:true});
        email.setProperty("body", "Just arrived in Huesca");
 
getToList

Gets the list of recipients added to this message in the To field.

Signature
StringArray getToList();
Return value
StringArray an array of DOMString containing each one of the recipients in the To field for this message (email addresses).
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:true});
        var recipients = email.getToList();
        alert(recipients[0]);
 
getTo

Gets a recipient from the list of recipients (To).

Signature
DOMString getTo(unsigned short index);
Parameters
  • index: an int pointing the position of the recipient to be retrieved.
Return value
DOMString containing the telephone number (email address).
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided (e.g. the requested recipient index is out of bounds)
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:true});
        alert(email.getTo(0));
 
getCCList

Gets the list of recipients added to this message in the CC field.

Signature
StringArray getCCList();
Return value
StringArray array of DOMString containing each one of the recipients in the CC field for this message (email addresses).
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:true});
        var recipients = email.getCCList();
        alert(recipients[0]);
 
getCC

Gets a recipient from the list of recipients (CC).

Signature
DOMString getCC(unsigned short index);
Parameters
  • index: an int pointing the position of the recipient to be retrieved.
Return value
DOMString containing the telephone number (email address).
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided (e.g. the requested recipient index is out of bounds)
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:true});
        alert(email.getCC(0));
 
getBCCList

Gets the list of recipients added to this message in the BCC field.

Signature
StringArray getBCCList();
Return value
StringArray an array of String containing each one of the recipients in the BCC field for this message (email addresses).
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:true});
        var recipients = email.getBCCList();
        alert(recipients[0]);
 
getBCC

Gets a recipient from the list of recipients (BCC).

Signature
DOMString getBCC(unsigned short index);
Parameters
  • index: an integer pointing the position of the recipient to be retrieved.
Return value
DOMString containing the telephone number (email address).
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided (e.g. the requested recipient index is out of bounds)
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com", cc:"pabasa1@corp.vodafone.es",bcc:"guillermo.caudevilla@vodafone.com",subject:"Hello from Huesca",body:"How Are You?",attachments:files,store:true});
        alert(email.getBCC(0));
 
appendTo

Adds (appends) a new recipient to the list.

Signature
void appendTo(DOMString emailAddress);
Parameters
  • emailAddress: a DOMString containing the email address of the recipient to be added.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided (e.g. if destination hasn't an email address format)
Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        email.appendTo("guillermo.caudevilla@vodafone.com");
 
clearTo

Removes the entire To's list

Signature
void clearTo();
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        email.clearTo();
 
appendCC

Adds (appends) a new recipient to the CC list.

Signature
void appendCC(DOMString emailAddress);
Parameters
  • emailAddress: a DOMString containing the email address of the recipient to be added.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",cc:"ester@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        email.appendCC("guillermo.caudevilla@vodafone.com");
 
clearCC

Removes the entire CCs list

Signature
void clearCC();
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",cc:"ester@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        email.clearCC();
 
appendBCC

Adds (appends) a new recipient to the BCC list.

Signature
void appendBCC(DOMString emailAddress);
Parameters
  • emailAddress: a String containing the email address of the recipient to be added.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",bcc:"ester@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        email.appendBCC("guillermo.caudevilla@vodafone.com");
 
clearBCC

Removes the entire BCCs list

Signature
void clearBCC();
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",bcc:"ester@gmail.com",subject:"Hello from Huesca",body:"How Are You?",store:true});
        email.clearBCC();
 
getAttachments

Gets the list of attachments added to this message.

Signature
FileArray getAttachments();
Return value
FileArray an array of Files containing the email attachments.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",bcc:"ester@gmail.com",subject:"Hello from Huesca",body:"How Are You?",attachment: files,store:true});
        var attachments = getAttachments();
        alert(attachments[0]);
 
getAttachment

Gets an attachment from the list of added attachments.

Signature
File getAttachment(unsigned short index);
Parameters
  • index: an integer pointing to the position of the attachment to be retrieved.
Return value
File containing the file object.
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",bcc:"ester@gmail.com",subject:"Hello from Huesca",body:"How Are You?",attachment: files,store:true});
        alert(getAttachment(0));
 
appendAttachment

Adds a file to the attachment list of the message.

Signature
void appendAttachment(File myAttachment);
Parameters
  • myAttachment: a String containing the path of the file to be attached.
Exceptions
  • SecurityError: PERMISSION_DENIED_ERROR when access is denied by the security policy.
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
API features
http://bondi.omtp.org/api/messaging.email.attach
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",bcc:"ester@gmail.com",subject:"Hello from Huesca",body:"How Are You?",attachment: files,store:true});
        var files2=bondi.filesystem.mount("\Huesca2.jpg");
        email.appendAttachment(files2);
 
clearAttachments

Removes the entire attachments list

Signature
void clearAttachments();
Exceptions
  • DeviceAPIError: INVALID_ARGUMENT_ERROR if an invalid parameter has been provided
Code example
        var files=bondi.filesystem.mount("\Huesca.jpg");
        var email = bondi.messaging.createEmail({from:"pfracat@corp.vodafone.es",to:"pedro@gmail.com",bcc:"ester@gmail.com",subject:"Hello from Huesca",body:"How Are You?",attachment: files,store:true});
        email.clearAttachments();