Hi i want to know that is there any activity from where i can fill the email activity and start it from my program.. like this...
To populate a subject, cc, bcc and/or body, simply append this information onto the mailto url:
data: {
type : "mail",
url: "mailto:example@example.org?subject=this%20is%20a%20test&cc=example2@example.org",
}
Regarding how to include an attachment, that depends on which version of Firefox OS you want your app to be compatible with.
As of Firefox OS 1.2, you can simply add blobs
and filenames
objects to the data object:
data: {
type : "mail",
url: "mailto:example@example.org?subject=this%20is%20a%20test&cc=example2@example.org",
blobs: [testBlob],
filenames: ['test.html']
}
I've updated the Firefox OS Boilerplate app to include a working example of this. The related bits of Firefox OS code can be found in apps/email/js/app_messages.js and apps/email/js/mail_app.js.
Prior to Firefox 1.2, the new
(mail) activity does not accept these parameters and you'll need to use the share
activity:
var sharingImage = new MozActivity({
name: "share",
data: {
type: "image/*",
number: 1,
blobs: [blob]
}
});
The Firefox OS Boilerplate includes a working example of the share activity.
The relevant code showing that attachments are limited to the share activity in version 1.1 is in apps/email/js/mail-app.js.