I send emails through Intent. Sometimes they need to have an attachment, but the attachment receives the same MIME type as the primary email address (message / rf822).
Intent intent = new Intent(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_EMAIL, new String[] { address }); intent.putExtra(Intent.EXTRA_TEXT, body); intent.putExtra(Intent.EXTRA_SUBJECT, subject); if (fileName != null) { intent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + fileName)); } intent.setType("message/rfc822");
Is there a way to specify the MIME type for the attachment?
android mime-types email attachment
Gene vincent
source share