Image attachment to mail .. as in android?

I can select the image and its path using the intent. using this image path. I have to set this image as an attachment of the contents of the mail body. how is it possible in android ???

+2
source share
1 answer
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,getResources().getString(R.string.emlSendToFriendSubject)); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[]{emailto}); emailIntent.setType("text/plain"); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,getResources().getString(R.string.emlSendToFriendBody)); File file = getFileStreamPath(EMAIL_TEMP_FILE); emailIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); emailIntent.setType("image/jpeg"); emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+file.getAbsolutePath())); startActivityForResult(Intent.createChooser(emailIntent, getResources().getString(R.string.btnSendToFriend)),ActMain.EMAIL_DONE); 
+5
source

All Articles