I want to send multiple images.
I tried setType("image/jpeg")
also, I see this question posted in a lot of places, but didn't find correct answer
val emailIntent = Intent(android.content.Intent.ACTION_SEND_MULTIPLE, Uri.parse("mailto:" + context?.resources?.getString(R.string.email)))
emailIntent.setType("application/image")
val uris = ArrayList<Uri>()
for (file in filePaths) {
val fileIn = File(file)
val u = Uri.fromFile(fileIn)
uris.add(u)
}
emailIntent.putExtra(Intent.EXTRA_SUBJECT, emailSubject)
emailIntent.putExtra(Intent.EXTRA_TEXT, emailBody)
emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris)
context?.startActivity(Intent.createChooser(emailIntent, "Email:"));