Skip to content

Instantly share code, notes, and snippets.

@MotiurRahman
Last active April 6, 2018 09:40
Show Gist options
  • Save MotiurRahman/c0bab248003f53e3e98b0ee5ed8d83f9 to your computer and use it in GitHub Desktop.
Save MotiurRahman/c0bab248003f53e3e98b0ee5ed8d83f9 to your computer and use it in GitHub Desktop.
Email_dialog
function clickedSendMail() {
Ti.API.trace("[pocBlobAsAnAttachment] >> [clickedSendMail]");
var blobObjectOfWebView = $.myWebView.toImage();
Ti.API.debug("[pocBlobAsAnAttachment] >> [init] >> blobObjectOfWebView >>", blobObjectOfWebView);
var emailDialog = Ti.UI.createEmailDialog({
html : true
});
emailDialog.subject = "Test mail to check Blob attachment";
emailDialog.toRecipients = ['Email'];
emailDialog.messageBody = '<b>Blob file as an attachment</b>';
emailDialog.addAttachment(blobObjectOfWebView);
emailDialog.open();
}
$.index.open();
<Alloy>
<Window class="container" layout="vertical">
<WebView id="myWebView" height="70%" width="100%" url="http://www.appcelerator.com"/>
<Button id="btnSend" title="Send Mail" color="White" top="20" backgroundColor="red" height="19%" width="100%" onClick="clickedSendMail"></Button>
</Window>
</Alloy>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment