Hello Friends,
send email from android device with attachment using intent here is the code for that
This code is perfectly working for me to send email with image attachment
****+++++++++++++++++++++++++++++++++++++++++++*****
Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("jpeg/image");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
new String[] { "" });
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "subject");
Date cal = Calendar.getInstance().getTime();
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "body");
Uri uri = Uri.fromFile(new File(Environment
.getExternalStorageDirectory(), "/sunil.jpg"));
emailIntent.putExtra(Intent.EXTRA_STREAM, uri);
emailIntent.setType("text/plain");
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
This comment has been removed by the author.
ReplyDeleteThanks Tony....!
ReplyDeleteHi sunil i tried with your example but while sending an image it showing error on device that couldn't attach error
ReplyDeletehow to attach multiple files ?
ReplyDelete