In this article lets look at several options, libraries and examples for sending email in android.

You can send email just via intents. You need to chose an action based on whether an attachment is part of the email or not.

  1. ACTION_SENDTO (for no attachment) or
  2. ACTION_SEND (for one attachment) or
  3. ACTION_SEND_MULTIPLE (for multiple attachments)

The MIME Type can be:

  1. "text/plain"
  2. "*/*"

The Extras can be:

  1. Intent.EXTRA_EMAIL – A string array of all "To" recipient email addresses.
  2. Intent.EXTRA_CC – A string array of all "CC" recipient email addresses.
  3. Intent.EXTRA_BCC – A string array of all "BCC" recipient email addresses.
  4. Intent.EXTRA_SUBJECT – A string with the email subject.
  5. Intent.EXTRA_TEXT – A string with the body of the email.
  6. Intent.EXTRA_STREAM – A Uri pointing to the attachment. If using the ACTION_SEND_MULTIPLE –  action, this should instead be an ArrayList containing multiple  Uri objects.

Here is a Kotlin example to send email:

fun composeEmail(addresses: Array<String>, subject: String, attachment: Uri) {
    val intent = Intent(Intent.ACTION_SEND).apply {
        type = "*/*"
        putExtra(Intent.EXTRA_EMAIL, addresses)
        putExtra(Intent.EXTRA_SUBJECT, subject)
        putExtra(Intent.EXTRA_STREAM, attachment)
    if (intent.resolveActivity(packageManager) != null) {

Here is a Java Example to send email in android:

public void composeEmail(String[] addresses, String subject, Uri attachment) {
    Intent intent = new Intent(Intent.ACTION_SEND);
    intent.putExtra(Intent.EXTRA_EMAIL, addresses);
    intent.putExtra(Intent.EXTRA_SUBJECT, subject);
    intent.putExtra(Intent.EXTRA_STREAM, attachment);
    if (intent.resolveActivity(getPackageManager()) != null) {

Proceed below to see more options for sending email. Feel free to contribute more examples.

(a). EmailIntentBuilder

This an Android Library for the creation of SendTo Intents with mailto: URI.

Step 1 – Installation

Install the library by adding the following statement in your build.gradle  file:

implementation ‘de.cketti.mailto:email-intent-builder:2.0.0’

Step 2

Then set the appropriate fields to be sent:

        .subject("Message from an app")
        .body("Some text here")


Here is a full example to use this library to send email:


import android.os.Bundle;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;

import de.cketti.mailto.EmailIntentBuilder;

public class MainActivity extends AppCompatActivity {
    private View mainContent;
    private EditText emailTo;
    private EditText emailCc;
    private EditText emailBcc;
    private EditText emailSubject;
    private EditText emailBody;

    protected void onCreate(Bundle savedInstanceState) {

        mainContent = findViewById(;
        emailTo = findViewById(;
        emailCc = findViewById(;
        emailBcc = findViewById(;
        emailSubject = findViewById(;
        emailBody = findViewById(;

        findViewById( -> sendEmail());

    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(, menu);
        return true;

    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId() == {
        return true;

    private void sendFeedback() {
        boolean success = EmailIntentBuilder.from(this)

        if (!success) {
            Snackbar.make(mainContent, R.string.error_no_email_app, Snackbar.LENGTH_LONG).show();

    void sendEmail() {
        String to = emailTo.getText().toString();
        String cc = emailCc.getText().toString();
        String bcc = emailBcc.getText().toString();
        String subject = emailSubject.getText().toString();
        String body = emailBody.getText().toString();

        EmailIntentBuilder builder = EmailIntentBuilder.from(this);

        try {
            if (!TextUtils.isEmpty(to)) {
            if (!TextUtils.isEmpty(cc)) {
            if (!TextUtils.isEmpty(bcc)) {
            if (!TextUtils.isEmpty(subject)) {
            if (!TextUtils.isEmpty(body)) {

            boolean success = builder.start();
            if (!success) {
                Snackbar.make(mainContent, R.string.error_no_email_app, Snackbar.LENGTH_LONG).show();
        } catch (IllegalArgumentException e) {
            String errorMessage = getString(R.string.argument_error, e.getMessage());
            Snackbar.make(mainContent, errorMessage, Snackbar.LENGTH_LONG).show();


Here are the links:

  1. Directly Download the code here.
  2. Browse through the code or read more here.
  3. Follow Author here.

(b). Maildroid

MMaildroid is a small robust android library for sending emails using SMTP server.

It uses Oracle Java Mail API to handle connections and sending emails.

Key Features

  • Sending emails using SMTP protocol incoming_envelope
  • Compatible with all smtp providers tada
  • Sending HTML/CSS styled emails art
  • Library is using Java Mail API that is well known as best library for sending emails telescope

Step 1: Installation

This library is hosted in jitpack. So start by adding jitpack in your root level build.gradle:

allprojects {
        repositories {
            maven { url '' }

Then you add the dependency:

dependencies {
            implementation 'com.github.nedimf:maildroid:v0.0.4-relase'

Step 2: Code

You can use builder pattern:

        .attachments() //List
        .onCompleteCallback(object : MaildroidX.onCompleteCallback{
        override val timeout: Long = 3000
        override fun onSuccess() {
            Log.d("MaildroidX",  "SUCCESS")
        override fun onFail(errorMessage: String) {
             Log.d("MaildroidX",  "FAIL")

Or DSL implementation

sendEmail {
      body("email body")
      attachments() //List
      callback {
          onSuccess {
              Log.d("MaildroidX",  "SUCCESS")
          onFail {
              Log.d("MaildroidX",  "FAIL")

Step 3: Download

Here are the links:

  1. Browse and Read more here.
  2. Follow author here.

(c). Sending Emails using Shelly

Shelly is a Fluent API for common Intent use-cases in Android.

This library wraps Intents with a clean and simple to understand interface for a number of specific use-cases. You can use it to send emails via Intent.

Step 1: Installation

Install Shell from jcenter:

implementation ''

Step 2: Send Email

To send email:
  .subject("Subject Text")
  .body("Email Body")

To send an email to multiple addresses:
 .to("", "", "")
 .subject("Subject Text")
 .body("Email Body")

To send an email with a cc:
 .to("", "", "")
 .cc("", "")
 .subject("Subject Text")
 .body("Email Body")

To send an email with bcc:
 .to("", "", "")
 .bcc("", "")
 .subject("Subject Text")
 .body("Email Body")


  1. Download the code here.