I am using following code to send email from my Android app:
Intent email = new Intent(Intent.ACTION_SEND);
email.putExtra(Intent.EXTRA_EMAIL, new String[]{"email@yahoo.com"});
email.putExtra(Intent.EXTRA_SUBJECT, "subject");
email.putExtra(Intent.EXTRA_TEXT, "message");
emailIntent.putExtra(Intent.EXTRA_STREAM, uri);
email.setType("plain/text");
startActivity(Intent.createChooser(email, "Choose an Email App:"));
This works fine for all email sending apps, but it shows too many options like Facebook, Twitter, Bluetooth to send this email. I just wanted to see email apps to choose from.
So, I replaced email.setType("plain/text");
with email.setType("message/rfc822");
Now it shows only email apps and works fine for all email apps installed in my device except the outlook app. The outlook app doesn't send attachments properly. At the receiving end, I get strange characters instead of an attached file.
Then, I replaced email.setType("message/rfc822");
with email.setType("application/octet-stream");
This solved the outlook attachment issue, but now I am unable to send emails with the default android email app. It sends emails without attachments.