-1

I would like to send mail with attached image to the same address.

slama007
  • 1,273
  • 2
  • 18
  • 34
  • please Do little bit surfing before ask the question.. this ans is available on stack http://stackoverflow.com/questions/9974987/how-to-send-an-email-with-a-file-attachment-in-android http://stackoverflow.com/questions/587917/trying-to-attach-a-file-from-sd-card-to-email – GovindRathod Aug 14 '14 at 09:07
  • @Concentrated_Attitude: Where do I put the email address of the sender please? – slama007 Aug 14 '14 at 09:31

2 Answers2

1

use below code hope it will help you

Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); 
emailIntent.setType("application/image");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{strEmail}); 
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"Test Subject"); 
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "From My App"); 
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///mnt/sdcard/Myimage.jpeg"));
startActivity(Intent.createChooser(emailIntent, "Send mail...")); 
0

Check out the android development training for more information and examples Android Training

Intent emailIntent = new Intent(Intent.ACTION_SEND);
// The intent does not have a URI, so declare the "text/plain" MIME type
emailIntent.setType(HTTP.PLAIN_TEXT_TYPE);
emailIntent.putExtra(Intent.EXTRA_EMAIL,
new String[] {"jon@example.com"}); // recipients
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Email subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Email message text");
emailIntent.putExtra(Intent.EXTRA_STREAM, 
Uri.parse("content://path/to/emai/attachment"));
// You can also attach multiple items by passing an ArrayList of Uris
startActivity(emailIntent);
Afsa
  • 2,025
  • 1
  • 16
  • 19