1

I am succeeded to attach and send single file using mail Intent. But I cant attach two files, I have used the below code from some of the websites.

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
emailIntent.setType("plain/text");

File file1 = getApplicationContext().getFileStreamPath("file1.csv");
File file2 = getApplicationContext().getFileStreamPath("file2.csv");

ArrayList<Uri> uris = new ArrayList<Uri>();
uris.add(Uri.fromFile(file1));
uris.add(Uri.fromFile(file2));

emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivity(Intent.createChooser(emailIntent, "Send mail..."));

I wrote the files in world_readable mode. But I dont know why I am not able to attach the files. Please give me your suggestion..

Neela
  • 1,328
  • 4
  • 23
  • 45
  • I dont understand why don't you search on SO, See this links http://stackoverflow.com/questions/2264622/android-multiple-email-attachments-using-intent and http://stackoverflow.com/questions/4552831/how-to-attach-multiple-files-to-email-client-in-android – MKJParekh Jan 31 '12 at 07:02
  • Thanks for your response.. I have searched almost everything.. I just followed the code as per the solutions found on those pages.. But I get mail with no attachments.. Actually dont know where I am wrong.. – Neela Jan 31 '12 at 08:36

0 Answers0