i am trying to send an e-mail with multiple attachments.
Intent emailIntent = new Intent(Intent.ACTION_SEND_MULTIPLE);
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {"[email protected]", "[email protected]"});
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "The Subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "The Text");
emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
emailIntent.setType("text/plain");
startActivity( Intent.createChooser(emailIntent, "Send Email Using: ") );
This works great when I send the email using gmail, but it doesn't attach the attachments if I send the e-mail using the e-mail client on a Nexus One. It has all the text, the subject, etc... but just no attachments. The email account I have is an exchange account if that matters...
Try This its work fine.
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
emailIntent.setType("plain/text");
ArrayList<Uri> uris = new ArrayList<Uri>();
String[] filePaths = new String[] {image1 Path,image2 path};
for (String file : filePaths) {
File fileIn = new File(file);
Uri u = Uri.fromFile(fileIn);
uris.add(u);
}
if ( !(app_preferences.getString("email", "") == null || app_preferences.getString("email", "").equals(""))) {
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] {app_preferences.getString("email", "")});
}
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject name");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Please find the attachment.");
emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivity(Intent.createChooser(emailIntent, "Email:"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With