Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23482] Android: EmailDialog fails to attach files when using Outlook

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2018-01-19T23:15:39.000+0000
Affected Version/sn/a
Fix Version/sRelease 7.0.2
ComponentsAndroid
Labelsandroid, emaildialog, outlook
ReporterMartyn Joyce
AssigneeJoshua Quick
Created2016-06-07T08:50:43.000+0000
Updated2018-01-22T18:35:57.000+0000

Description

I use createEmailDialog to send emails and attach locally created files to them. On Android the attachment does not get added if the user selects to send the email via Outlook. Everything works correctly if the user selects to send the email via Gmail. Please see screenshots in attachments

var emailDialog = Ti.UI.createEmailDialog({});
emailDialog.subject = "Test email with attachment";
emailDialog.toRecipients = ["test@me.com"];
emailDialog.messageBody = 'the file should be attached';

var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "test.txt");
		
emailDialog.addAttachment(file);
	
emailDialog.open();

Attachments

FileDateSize
gmail.png2016-06-07T08:48:41.000+000095128
outlook.png2016-06-07T08:48:41.000+000084102

Comments

  1. Nazmus Salahin 2016-06-07

    Hello, I am able to reproduce this issue with given code and given step. *Steps:* 1. Create a default classic project for android with following code.
       var win = Titanium.UI.createWindow({
       	title : 'Tab 1',
       	backgroundColor : '#fff'
       });
       
       win.open();
       
       var emailDialog = Ti.UI.createEmailDialog({});
       
       emailDialog.subject = "Test email with attachment";
       
       emailDialog.toRecipients = ["test@me.com"];
       
       emailDialog.messageBody = 'the file should be attached';
       
       var file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "test.txt");
       
       emailDialog.addAttachment(file);
       
       emailDialog.open();
       
       
    2. Paste test.txt file in resources folder. 3. Build and run the app on android device. Result : On Android the attachment does not get added if the user selects to send the email via Outlook. Everything works correctly if the user selects to send the email via Gmail. Note: To test this issue Gamil and Outlook app must be installed in the device *Environment*: *Device info:* HTC One (Android 4.4.3) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.3.0.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0
  2. Ashraf Abu 2016-06-08

    Based on what's happening, it looks like the Outlook application is not handling the receiving of the attachment. I believe there is nothing wrong with it. (I can be wrong but I'm leaning towards that Outlook is not handling the attachment correct). Another way to do this is to use Intents. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.Intent
  3. Martyn Joyce 2016-06-08

    ok, thanks for looking into it
  4. Ashraf Abu 2016-06-08

    [~martz256] Please let us know if there's any updates you want to give.
  5. Joshua Quick 2017-12-01

    I've confirmed that the fix for [TIMOB-25541] fixes this issue as well... PR (master): https://github.com/appcelerator/titanium_mobile/pull/9520
  6. Joshua Quick 2018-01-09

    PR (7.0.x): https://github.com/appcelerator/titanium_mobile/pull/9709
  7. Lokesh Choudhary 2018-01-10

    FR passed for master & PR merged. FR passed for backport , waiting for merge to get enabled.
  8. Lokesh Choudhary 2018-01-19

    Master & backport PR's merged.
  9. Lokesh Choudhary 2018-01-22

    Verified the fix with SDK 7.1.0.v20180121202754 & 7.0.2.v20180119173957. Closing. Studio Ver: 5.0.0.201712081732 SDK Ver: 7.0.2.v20180119173957, 7.1.0.v20180121202754 OS Ver: 10.13.2 Xcode Ver: Xcode 9.2 Appc NPM: 4.2.11 Appc CLI: 7.0.1 Daemon Ver: 1.0.1 Ti CLI Ver: 5.0.14 Alloy Ver: 1.10.10 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 1.8.0_101 Devices: samsung SM-G955U1 — Android 7.0 google Nexus 5 — Android 6.0.1 google Pixel — Android 7.1.1

JSON Source