The Email Dialog is created by Titanium.UI.createEmailDialog and allows you to send in application emails on behalf of the application user.
| Name | Description |
|---|---|
| addAttachment | add an attachment to the email. the attachment can either be a Blob or File object. |
| addEventListener | add an event listener for the instance to receive view triggered events |
| fireEvent | fire a synthesized event to the views listener |
| open | open the email dialog. the email dialog itself is a modal window |
| removeEventListener | remove a previously added event listener |
| Name | Type | Description |
|---|---|---|
| CANCELLED | int | constant for the CANCELLED status result |
| FAILED | int | constant for the FAILED status result |
| SAVED | int | constant for the SAVED status result |
| SENT | int | constant for the SENT status result |
| barColor | string | the bar color of the email dialog window when opened |
| bccRecipients | array | array of email BCC: recipients |
| ccRecipients | array | array of email CC: recipients |
| html | boolean | boolean to indicate whether the email messageBody should be sent as HTML content type. defaults to false |
| messageBody | string | the email message body |
| subject | string | the subject line for the email |
| toRecipients | array | array of email recipients |
| Name | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| complete |
fired when the email dialog has completed sending the email Event properties
|
In this example, we send an email with a file attachment.
var emailDialog = Titanium.UI.createEmailDialog() emailDialog.subject = "Hello from Titanium"; emailDialog.toRecipients = ['foo@yahoo.com']; emailDialog.messageBody = '<b>Appcelerator Titanium Rocks!</b>'; var f = Ti.Filesystem.getFile('cricket.wav'); emailDialog.addAttachment(f); emailDialog.open();