Titanium.UI.EmailDialog

object of Titanium.UI
           
0.8

The Email Dialog is created by Titanium.UI.createEmailDialog and allows you to send in application emails on behalf of the application user.

Methods

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

Properties

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

Events

Name Description
complete

fired when the email dialog has completed sending the email

Event properties

error

string message of the error or null if successfully sent

result

result status either as SENT, SAVED, CANCELLED or FAILED

sourcethe source object that fired the event
success

boolean to indicate if the email was successfully sent

typethe name of the event fired

Code Examples

Simple Email Dialog with Attachment

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();