I am trying to use an intent to send an email from my application but the To field of the email will not populate. If I add code to fill in the subject or text, they work fine.
Couple of things:
1 - You need to set the action constant variable as ACTION_SENDTO. Intent intentEmail = new Intent(Intent.ACTION_SENDTO);
2 - If you want it to be opened by only the mail then use the setData() method: intentEmail.setData(Uri.parse("mailto:"));
Otherwise it will ask you to open it as text, image, audio file by other apps present on your device.
3 - You need to pass the email ID string as an array object and not just as a string. String is: "name@email.com". Array Object of the string is: new String[] {"email1", "email2", "more_email"}.
intentEmail.putExtra(Intent.EXTRA_EMAIL, new String[] {"email@overflow.com", "abcd@stack.com"});