Getting multiple attachments to email in both Mail and Gmail with Android
<p>I can get both Mail and Gmail to attach multiple csv files to an email.</p>

<p>When sent via Mail <strong>all</strong> the attachments are delivered.<br>
When sent by Gmail <strong>none</strong> of the attachments are delivered.</p>

<p>I have read the documentation <a href="http://developer.android.com/training/sharing/send.html#send-binary-content" rel="nofollow">Send Binary Content</a>.  I have searched but only found a solution for Gmail that does not work with Mail.  Mail seems happy with just about any approach.  Gmail just doesn't want to play.</p>

<p>Has anyone found a solution for sending multiple attachments that works with both Mail and Gmail?</p>

<pre><code>final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
String subject = context.getString(R.string.export_data_email_header);
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
emailIntent.setType("text/csv");

ArrayList&lt;Uri&gt; uris = new ArrayList&lt;Uri&gt;();
if (diariesSelected) uris.add(Uri.fromFile(context.getFileStreamPath("diaries.csv")));
...
emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);

context.startActivity(emailIntent);
</code></pre>

<p>And the code used to create the file</p>

<pre><code> FileOutputStream fos = context.openFileOutput(path, Context.MODE_WORLD_READABLE);
 OutputStreamWriter writer = new OutputStreamWriter(fos);
 writer.append(builder.toString());
 writer.close();
 fos.close();
</code></pre>
