1
String value = text.getText().toString();

        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"test@test.test"});
        intent.putExtra(Intent.EXTRA_SUBJECT, "subject");
        intent.putExtra(Intent.EXTRA_TEXT, value);

        startActivity(Intent.createChooser(intent, "Send Email"));

this code runs, but it show a list of applications like notepad (and other notepad app), whatsapp (and several chat app).

I need a list of only email clients. I done a long search but the code is always same.

Pol Hallen
  • 1,852
  • 6
  • 32
  • 44

1 Answers1

2

try the following code with content type:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { "some@email.address" });
intent.putExtra(Intent.EXTRA_SUBJECT, "subject");
intent.putExtra(Intent.EXTRA_TEXT, "mail body");
startActivity(Intent.createChooser(intent, ""));

Edit1: Check out this post for sending email directly without opening the email client.

Community
  • 1
  • 1
Praful Bhatnagar
  • 7,425
  • 2
  • 36
  • 44
  • Better :-) Now I see: bump, crypto4all, drive, email, gmail, k-9 mail, nfc tapping huh? Can I create a complete form to send automatically an email? thanks – Pol Hallen Dec 05 '12 at 18:48
  • you can also try with `i.setType("message/rfc822");` this may remove non email client from list.. could not understand your comment.. do you want to send email without opening the email application? – Praful Bhatnagar Dec 05 '12 at 18:51
  • sorry 4 my english :-( alternative of use of intents, create a form to send directly by email (without email client) – Pol Hallen Dec 05 '12 at 18:55