0

On button click, I want to attach an image from drawable and send an email(from chooser). My button click works, email chooser opens. For example, Gmail opens and the image is attached. The problem is that the image doesn't have a proper extension. When the email is sent and the receiver downloads the attachment and renames it with .jpg. It perfectly works then. I have posted the code below. I have added the project on GitHub.

The link is https://github.com/TheKushalBhagat/EmailButton. You can download, work on it and please help me with the solution.

My code: Code

Sky
  • 1,435
  • 1
  • 15
  • 24
  • try : String path = MediaStore.Images.Media.insertImage(getContentResolver(), mBitmap, "Image Description", null); Uri uri = Uri.parse(path); convert drawable to bitmap and use it as intent.putExtra(Intent.EXTRA_STREAM, uri); – Divyesh Patel May 19 '17 at 04:57
  • Check this http://stackoverflow.com/questions/14457457/android-intent-send-an-email-with-image-attachment and http://stackoverflow.com/questions/9860156/how-to-send-email-with-attachmentimage – Ninja May 19 '17 at 04:58

0 Answers0