I am tryed two ways to send email
with image attachment.The attachment is displaying at the time of writing subject,boby everything aftersend that email at the receiver it's showing only subject & Body
only no attacthment the user getting.I am not understanding what's worong with my code below is my code. please give my Any suggestion to finish this task.
Type 1:-
Intent picMessageIntent = new Intent(Intent.ACTION_SEND);
picMessageIntent.setType("image/jpeg");
File downloadedPic = new File(Environment.getExternalStorageDirectory(), strFileName + ".jpg");// Art_Nature
picMessageIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(downloadedPic));//screenshotUri );//Uri.fromFile(new File("downloadedPic"))); //Uri.fromFile(downloadedPic)); // Uri.fromFile(new File("/path/to/downloadedPic")));
startActivity(Intent.createChooser(picMessageIntent, "Share image using"));
Type 2:
ArrayList<Uri> uris = new ArrayList<Uri>();
Uri u;
Intent picMessageIntent = new Intent(Intent.ACTION_SEND);
picMessageIntent.setType("image/jpeg");
File downloadedPic = new File(Environment.getExternalStorageDirectory(), strFileName + ".jpg");// Art_Nature
if(downloadedPic.exists())
{
Uri u1 = Uri.fromFile(downloadedPic);
uris.add(u1);
picMessageIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
startActivity(picMessageIntent);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…