Skip to content

Instantly share code, notes, and snippets.

@rajubd49
Created April 16, 2015 09:34
Show Gist options
  • Save rajubd49/64e62afbcab9b86a25f0 to your computer and use it in GitHub Desktop.
Save rajubd49/64e62afbcab9b86a25f0 to your computer and use it in GitHub Desktop.
Email Attachment local file - Appcelerator Titanium
var win = Ti.UI.createWindow({
backgroundColor : "gray"
});
var btn = Ti.UI.createButton({
title : "open email dialogue",
top : 100,
left : 100,
height : 150,
width : 150
});
btn.addEventListener("click", function() {
var emailDialog = Ti.UI.createEmailDialog();
emailDialog.subject = "Hello from Titanium";
emailDialog.toRecipients = ['xyzabc@yahoo.com'];
emailDialog.messageBody = '<b>Appcelerator Titanium Rocks!</b>';
var f = Ti.Filesystem.getFile('cricket.wav');
emailDialog.addAttachment(f);
emailDialog.open();
});
win.add(btn);
win.open();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment