-1

I am making application in IOS and Android using titanium .I want to open email composer (having some attachment) on button click.can you please tell me how can I do in IOS and Android.?

Thanks

Rohit
  • 685
  • 3
  • 13
  • 28

1 Answers1

1

Directly from the documentation. This assumes you already have created your button.

button.addEventListener('click', function(e) {
    // Create email window
    var emailDialog = Ti.UI.createEmailDialog();
    emailDialog.subject = "Hello from Titanium";
    emailDialog.toRecipients = ['foo@yahoo.com'];
    emailDialog.messageBody = '<b>Appcelerator Titanium Rocks!</b>';
    // Add attachment
    var f = Ti.Filesystem.getFile('cricket.wav');
    emailDialog.addAttachment(f);
    // Open the window
    emailDialog.open();
});
Josiah Hester
  • 6,065
  • 1
  • 24
  • 37