How does one send a simple email message, in code, on Android?
Intent sendIntent;
sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Test Subject");
sendIntent.putExtra(Intent.EXTRA_TEXT, "Test Text");
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + fileName));
sendIntent.setType("image/jpeg");
startActivity(Intent.createChooser(sendIntent, "Send Mail"));
Check out the code at anddev.org for how to do it using intents.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With