Search code examples
iphoneemailtitaniumappcelerator

How to start the mail app from titanium


How do you start the Mail app from a Titanium app?

I am looking for the equivalent of an HTML mailto: link where I can specify the email and maybe the subject from with in a windowView.

I am not using a webView.

Will


Solution

  • Try this one:

    var emailDialog = Titanium.UI.createEmailDialog();
    emailDialog.subject = "Sending email from Titanium";
    emailDialog.toRecipients = ['[email protected]'];
    emailDialog.messageBody = 'Appcelerator Titanium - Testing sending email';
    
    emailDialog.open();
    

    But remember that you cannot test this send email feature from iPhone Simulator (because iPhone simulator lacks of setting email account). Try to check in real phone.