0

I have one ImageSlider and i have one button,on Button Click event i want to send an Email with image attach from Imageslider.

I did code like this but it's not working.

mail.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        Intent emailIntent = new Intent(Intent.ACTION_SEND);                
        emailIntent.setType("application/image");
        emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Hi");
        emailIntent.putExtra(Intent.EXTRA_TEXT, "");
        String imageFileName = array.get(0).getAsJsonObject().get("images").getAsJsonArray().get(0).getAsJsonObject().get("image").getAsString();
        emailIntent.putExtra(Intent.EXTRA_STREAM,Uri.parse(imageFileName));
        startActivity(Intent.createChooser(emailIntent, "Email via..."));
    }
});

It must show me an image in the email,but it Shows me Toast Message

Unable to Attach File

Parth Lotia
  • 753
  • 1
  • 7
  • 25

1 Answers1

0

You need to download the images before sending them to email and after that, you also need to make sure that the image should need to exceed the limit of upload size provided by Google. In that case, you have upload image on the S3 server or drive and in email intent, you have to pass the link to that image. let me know the case here.