How to set mime type for Android email application

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?

+7
android mime-types email attachment
source share

No one has answered this question yet.

See related questions:

3998
How to check email address in JavaScript
3295
Why is the Android emulator so slow? How can we speed up Android emulator development?
3175
How to check email address with regex?
2510
How to keep Android activity state by saving instance state?
968
What is the correct mime type for docx, pptx, etc.?
66
Attempting to attach file from SD card to email
8
Register new mime type in android
4
Send an email to Android by selecting only email applications and specifying the mime type of application
0
MIME type used when attaching an HTML page to email
0
Should Android mailto links need an email address?

All Articles