i found a way to send plain text email using intent:
final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("text/plain");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new
String[]{"example@mail.com"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Test");
But I need to send HTML formatted text.
Trying to setType(“text/html”) doesn’t work.
You can pass
Spannedtext in your extra. To ensure that the intent resolves only to activities that handle email (e.g. Gmail and Email apps), you can useACTION_SENDTOwith a Uri beginning with the mailto scheme. This will also work if you don’t know the recipient beforehand: