Android – Send email from your Android application – ACTION_SEND intent

By -

The below code can be tested with the real device:

Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822") ;
i.putExtra(Intent.EXTRA_EMAIL, new String[]{"demo_testing@gmail.com"});
i.putExtra(Intent.EXTRA_SUBJECT,"subject Title");
i.putExtra(Intent.EXTRA_TEXT,"Message body description");
startActivity(Intent.createChooser(i, "Select email application"));

But while testing it with an emulator, you need to make correction with:
i.setType("text/plain");

CEO & Co-Founder at SolGuruz® | Organiser @ GDG Ahmedabad | Top 0.1% over StackOverflow | 15+ years experienced Tech Consultant | Helping startups with Custom Software Development

Loading Facebook Comments ...
Loading Disqus Comments ...