Problem Description
When you add an attachment to the email Dialog, it won't send the mail
Test Case
var emailDialog = Titanium.UI.createEmailDialog();
emailDialog.setSubject('Hello from Titanium!');
emailDialog.setToRecipients(['mauropm@gmail.com']);
emailDialog.setCcRecipients(['mauropm+test@gmail.com']);
emailDialog.setBccRecipients(['mauropm+bcc@gmail.com']);
if (Ti.Platform.name == 'iPhone OS') {
emailDialog.setMessageBody('<b>Appcelerator Titanium Rocks!</b>å');
emailDialog.setHtml(true);
emailDialog.setBarColor('#336699');
} else {
emailDialog.setMessageBody('Appcelerator Titanium Rocks!');
}
// attach a file
var f = Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'test.pdf');
emailDialog.addAttachment(f);
emailDialog.addEventListener('complete',function(e)
{
if (e.result == emailDialog.SENT)
{
if (Ti.Platform.osname != 'android') {
// android doesn't give us useful result codes.
// it anyway shows a toast.
alert("message was sent");
}
}
else
{
alert("message was not sent. result = " + e.result);
}
});
emailDialog.open();
Steps to reproduce
1. Create a new Mobile Project Classic Titanium
2. Paste the test case to the app.js
3. Run it
4. Results: the code will alert that the mail was sent, but it never goes out of the device.
No comments