Enviar Intención de Correo electrónico


Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/html");
intent.putExtra(Intent.EXTRA_EMAIL, "[email protected]");
intent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
intent.putExtra(Intent.EXTRA_TEXT, "I'm email body.");

startActivity(Intent.createChooser(intent, "Send Email"));

El código anterior abre un cuadro de diálogo que muestra las siguientes aplicaciones:- Bluetooth, Google Docs, Yahoo Mail, Gmail, Orkut, Skype, etc.

En realidad, quiero filtrar estas opciones de lista. Quiero mostrar solo aplicaciones relacionadas con el correo electrónico, por ejemplo, Gmail, Yahoo Mail. Cómo hacerlo?

He visto tal ejemplo en la aplicación 'Android Market'.

  1. Abrir Android Market app
  2. Abra cualquier aplicación donde el desarrollador haya especificado su dirección de correo electrónico. (Si no puede encontrar dicha aplicación, simplemente abra mi aplicación:- market://details?id = com.por computador06.vehículo.agenda.libre, O búsqueda por 'Diario del vehículo')
  3. Desplácese hacia abajo hasta'DESARROLLADOR'
  4. Haga clic en'Enviar correo electrónico'

El diálogo muestra solo aplicaciones de correo electrónico, por ejemplo, Gmail, Yahoo Mail, etc. No muestra Bluetooth, Orkut, etc. ¿Qué código produce dicho diálogo?

Author: Charlie Brumbaugh, 2012-01-02

28 answers

Cuándo cambiarás tu intención.setType como a continuación obtendrá

intent.setType("text/plain");

Use android.content.Intent.ACTION_SENDTO para obtener solo la lista de clientes de correo electrónico, sin facebook u otras aplicaciones. Sólo los clientes de correo electrónico. Ex:

new Intent(Intent.ACTION_SENDTO);

No te sugeriría que llegaras directamente a la aplicación de correo electrónico. Deje que el usuario elija su aplicación de correo electrónico favorita. No lo restrinjas.

Si usa ACTION_SENDTO, putExtra no funciona para agregar asunto y texto a la intent. Usar Uri para agregar el sujeto y el cuerpo texto.

EDITAR: Podemos usar message/rfc822 en lugar de "text/plain" como tipo MIME. Sin embargo, eso no indica "solo ofrecer clientes de correo electrónico" indicates indica "ofrecer cualquier cosa que soporte los datos de message/rfc822". Eso podría incluir fácilmente alguna aplicación que no son clientes de correo electrónico.

message/rfc822 soporta tipos MIME de .mhtml, .mht, .mime

 185
Author: Padma Kumar,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-09-29 04:08:30

La respuesta aceptada no funciona en la 4.1.2. Esto debería funcionar en todas las plataformas:

Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
            "mailto","[email protected]", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
emailIntent.putExtra(Intent.EXTRA_TEXT, "Body");
startActivity(Intent.createChooser(emailIntent, "Send email..."));

Espero que esto ayude.

Actualización: De acuerdo con marcwjj, parece que en la versión 4.3, necesitamos pasar una matriz de cadenas en lugar de una cadena para la dirección de correo electrónico para que funcione. Es posible que necesitemos agregar una línea más:

intent.putExtra(Intent.EXTRA_EMAIL, addresses); // String[] addresses

Ref link

 783
Author: thanhbinh84,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-05-23 10:31:30

Hay tres enfoques principales:

String email = /* Your email address here */
String subject = /* Your subject here */
String body = /* Your body here */
String chooserTitle = /* Your chooser title here */

1. Personalizado Uri:

Uri uri = Uri.parse("mailto:" + email)
    .buildUpon()
    .appendQueryParameter("subject", subject)
    .appendQueryParameter("body", body)
    .build();

Intent emailIntent = new Intent(Intent.ACTION_SENDTO, uri);
startActivity(Intent.createChooser(emailIntent, chooserTitle));

2. Usando Intent extras:

Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:" + email));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(Intent.EXTRA_TEXT, body);
//emailIntent.putExtra(Intent.EXTRA_HTML_TEXT, body); //If you are using HTML in your body text

startActivity(Intent.createChooser(emailIntent, "Chooser Title"));

3. Biblioteca de SoporteShareCompat:

Activity activity = /* Your activity here */

ShareCompat.IntentBuilder.from(activity)
    .setType("message/rfc822")
    .addEmailTo(email)
    .setSubject(subject)
    .setText(body)
    //.setHtmlText(body) //If you are using HTML in your body text
    .setChooserTitle(chooserTitle)
    .startChooser();
 197
Author: Dipesh Rathod,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-09-02 15:20:16

Esto se cita del documento oficial de Android, lo he probado en Android 4.4, y funciona perfectamente. Ver más ejemplos en https://developer.android.com/guide/components/intents-common.html#Email

public void composeEmail(String[] addresses, String subject) {
    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.setData(Uri.parse("mailto:")); // only email apps should handle this
    intent.putExtra(Intent.EXTRA_EMAIL, addresses);
    intent.putExtra(Intent.EXTRA_SUBJECT, subject);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}
 85
Author: marcwjj,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-05-01 14:04:35

Una respuesta tardía, aunque descubrí una solución que podría ayudar a otros

Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
emailIntent.setData(Uri.parse("mailto: [email protected]"));
startActivity(Intent.createChooser(emailIntent, "Send feedback"));

Esta fue mi salida (Gmail + Bandeja de entrada y nada más)

introduzca la descripción de la imagen aquí

Obtuve esta solución de Sitio de Desarrolladores de Google

 50
Author: capt.swag,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-03 13:01:08

Intenta:

intent.setType("message/rfc822");
 32
Author: Magnus,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-01-03 23:12:56

Esto funciona para mí:

Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setData(Uri.parse("mailto:"));
intent.putExtra(Intent.EXTRA_EMAIL  , new String[] { "[email protected]" });
intent.putExtra(Intent.EXTRA_SUBJECT, "My subject");

startActivity(Intent.createChooser(intent, "Email via..."));

Es decir, use la acción ACTION_SENDTO en lugar de la acción ACTION_SEND. Lo he probado en un par de dispositivos Android 4.4 y limita la ventana emergente selector para mostrar solo las aplicaciones de correo electrónico (correo electrónico, Gmail, Yahoo Mail, etc.) y inserta correctamente la dirección de correo electrónico y el asunto en el correo electrónico.

 27
Author: Adil Hussain,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-08-07 09:05:52

Esta es la forma de hacerlo de acuerdo con Android Developer Docs añade estas líneas de código a tu app:

Intent intent = new Intent(Intent.ACTION_SEND);//common intent 
intent.setData(Uri.parse("mailto:")); // only email apps should handle this

Si desea agregar el cuerpo y el asunto, agregue esto

intent.putExtra(Intent.EXTRA_SUBJECT, "Your Subject Here");
intent.putExtra(Intent.EXTRA_TEXT, "E-mail body" );
 18
Author: Avi Parshan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-03-04 19:16:50

Si desea solo los clientes de correo electrónico debe usar android.content.Intent.EXTRA_EMAIL con una matriz. Aquí va un ejemplo:

final Intent result = new Intent(android.content.Intent.ACTION_SEND);
result.setType("plain/text");
result.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] { recipient });
result.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
result.putExtra(android.content.Intent.EXTRA_TEXT, body);
 13
Author: Addev,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-02-17 10:47:43

El siguiente código funciona para mí bien.

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("message/rfc822");
intent.putExtra(Intent.EXTRA_SUBJECT, subject);
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"abc@gmailcom"});
Intent mailer = Intent.createChooser(intent, null);
startActivity(mailer);
 8
Author: Anam Ansari,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-05-04 05:37:42

Finalmente llegar a la mejor manera de hacer

    String to = "[email protected]";
    String subject= "Hi I am subject";
    String body="Hi I am test body";
    String mailTo = "mailto:" + to +
            "?&subject=" + Uri.encode(subject) +
            "&body=" + Uri.encode(body);
    Intent emailIntent = new Intent(Intent.ACTION_VIEW);
    emailIntent.setData(Uri.parse(mailTo));
    startActivity(emailIntent);
 8
Author: Ajay Shrestha,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-06-19 19:22:27

Editar: Ya no funciona con las nuevas versiones de Gmail

Esta fue la única manera que encontré en ese momento para que funcionara con cualquier personaje.

La respuesta de Doreamon es el camino correcto ahora, ya que funciona con todos los caracteres en las nuevas versiones de Gmail.

Antigua respuesta:


Aquí está el mío. Parece que funciona en todas las versiones de Android, con soporte de asunto y cuerpo del mensaje, y soporte completo de caracteres utf-8:

public static void email(Context context, String to, String subject, String body) {
    StringBuilder builder = new StringBuilder("mailto:" + Uri.encode(to));
    if (subject != null) {
        builder.append("?subject=" + Uri.encode(Uri.encode(subject)));
        if (body != null) {
            builder.append("&body=" + Uri.encode(Uri.encode(body)));
        }
    }
    String uri = builder.toString();
    Intent intent = new Intent(Intent.ACTION_SENDTO, Uri.parse(uri));
    context.startActivity(intent);
}
 6
Author: minipif,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-06-13 10:33:33

Ninguna de estas soluciones funcionaba para mí. Aquí hay una solución mínima que funciona en Lollipop. En mi dispositivo, solo Gmail y las aplicaciones de correo electrónico nativas aparecen en la lista de selectores resultante.

Intent emailIntent = new Intent(Intent.ACTION_SENDTO,
                                Uri.parse("mailto:" + Uri.encode(address)));

emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(Intent.EXTRA_TEXT, body);
startActivity(Intent.createChooser(emailIntent, "Send email via..."));
 4
Author: scottt,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-05-13 01:35:12

El siguiente código funcionó para mí!!

import android.support.v4.app.ShareCompat;
    .
    .
    .
    .
final Intent intent = ShareCompat.IntentBuilder
                        .from(activity)
                        .setType("application/txt")
                        .setSubject(subject)
                        .setText("Hii")
                        .setChooserTitle("Select One")
                        .createChooserIntent()
                        .addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET)
                        .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

activity.startActivity(intent);
 4
Author: Suyog Gunjal,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-12-05 09:53:55

Funciona en Todas las versiones de Android:

String[] TO = {"[email protected]"};
    Uri uri = Uri.parse("mailto:[email protected]")
            .buildUpon()
            .appendQueryParameter("subject", "subject")
            .appendQueryParameter("body", "body")
            .build();
    Intent emailIntent = new Intent(Intent.ACTION_SENDTO, uri);
    emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
    startActivity(Intent.createChooser(emailIntent, "Send mail..."));
 4
Author: Usama Saeed US,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-03-21 23:54:43

Esto funciona para mí perfectamente bien:

    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.setData(Uri.parse("mailto:" + address));
    startActivity(Intent.createChooser(intent, "E-mail"));
 3
Author: EpicPandaForce,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-12-22 08:59:36

Si desea asegurarse de que su intent sea manejado solo por una aplicación de correo electrónico (y no por otras aplicaciones de mensajería de texto o sociales), use la acción ACTION_SENDTO e incluya el esquema de datos "mailto:". Por ejemplo:

public void composeEmail(String[] addresses, String subject) {
    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.setData(Uri.parse("mailto:")); // only email apps should handle this
    intent.putExtra(Intent.EXTRA_EMAIL, addresses);
    intent.putExtra(Intent.EXTRA_SUBJECT, subject);
    if (intent.resolveActivity(getPackageManager()) != null) {
        startActivity(intent);
    }
}

Encontré esto en https://developer.android.com/guide/components/intents-common.html#Email

 3
Author: Lamine Slimany,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-02-19 16:35:09

La mayoría de estas respuestas funcionan solo para un caso simple cuando no está enviando adjunto. En mi caso, a veces necesito enviar adjuntos (ACTION_SEND) o dos adjuntos (ACTION_SEND_MULTIPLE).

Así que tomé los mejores enfoques de este hilo y los combiné. Está usando la biblioteca de soporte ShareCompat.IntentBuilder pero solo muestro aplicaciones que coincidan con el uri ACTION_SENDTO con "mailto:". De esta manera, solo obtengo una lista de aplicaciones de correo electrónico con soporte para archivos adjuntos:

fun Activity.sendEmail(recipients: List<String>, subject: String, file: Uri, text: String? = null, secondFile: Uri? = null) {
    val originalIntent = createEmailShareIntent(recipients, subject, file, text, secondFile)
    val emailFilterIntent = Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:"))
    val originalIntentResults = packageManager.queryIntentActivities(originalIntent, 0)
    val emailFilterIntentResults = packageManager.queryIntentActivities(emailFilterIntent, 0)
    val targetedIntents = originalIntentResults
            .filter { originalResult -> emailFilterIntentResults.any { originalResult.activityInfo.packageName == it.activityInfo.packageName } }
            .map {
                createEmailShareIntent(recipients, subject, file, text, secondFile).apply { `package` = it.activityInfo.packageName }
            }
            .toMutableList()
    val finalIntent = Intent.createChooser(targetedIntents.removeAt(0), R.string.choose_email_app.toText())
    finalIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, targetedIntents.toTypedArray())
    startActivity(finalIntent)
}

private fun Activity.createEmailShareIntent(recipients: List<String>, subject: String, file: Uri, text: String? = null, secondFile: Uri? = null): Intent {
    val builder = ShareCompat.IntentBuilder.from(this)
            .setType("message/rfc822")
            .setEmailTo(recipients.toTypedArray())
            .setStream(file)
            .setSubject(subject)
    if (secondFile != null) {
        builder.addStream(secondFile)
    }
    if (text != null) {
        builder.setText(text)
    }
    return builder.intent
}
 2
Author: David Vávra,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-01-06 17:31:09

Tal vez deberías probar esto: intent.setType("plain/text");

Lo encontré aquí. Lo he usado en mi aplicación y solo muestra opciones de correo electrónico y Gmail.

 1
Author: sianis,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-01-02 13:54:43

Usa esto:

boolean success = EmailIntentBuilder.from(activity)
        .to("[email protected]")
        .cc("[email protected]")
        .subject("Error report")
        .body(buildErrorReport())
        .start();

Use el gradle de compilación:

compile 'de.cketti.mailto:email-intent-builder:1.0.0'
 1
Author: Manish,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-10-24 11:33:50

Esto es lo que uso, y funciona para mí:

//variables
String subject = "Whatever subject you want";
String body = "Whatever text you want to put in the body";
String intentType = "text/html";
String mailToParse = "mailto:";

//start Intent
Intent variableName = new Intent(Intent.ACTION_SENDTO);
variableName.setType(intentType);
variableName.setData(Uri.parse(mailToParse));
variableName.putExtra(Intent.EXTRA_SUBJECT, subject);
variableName.putExtra(Intent.EXTRA_TEXT, body);

startActivity(variableName);

Esto también permitirá al usuario elegir su aplicación de correo electrónico preferida. Lo único que esto no le permite hacer es establecer la dirección de correo electrónico del destinatario.

 1
Author: grasshopper,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-03 19:20:48

Este código funciona en mi dispositivo

Intent mIntent = new Intent(Intent.ACTION_SENDTO);
mIntent.setData(Uri.parse("mailto:"));
mIntent.putExtra(Intent.EXTRA_EMAIL  , new String[] {"[email protected]"});
mIntent.putExtra(Intent.EXTRA_SUBJECT, "");
startActivity(Intent.createChooser(mIntent, "Send Email Using..."));
 1
Author: Mahen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-06-01 03:28:23

Si quieres dirigirte a Gmail, puedes hacer lo siguiente. Ten en cuenta que la intent es "ACTION_SENDTO" y no "ACTION_SEND" y los campos de intent extra no son necesarios para Gmail.

String uriText =
    "mailto:[email protected]" + 
    "?subject=" + Uri.encode("your subject line here") + 
    "&body=" + Uri.encode("message body here");

Uri uri = Uri.parse(uriText);

Intent sendIntent = new Intent(Intent.ACTION_SENDTO);
sendIntent.setData(uri);
if (sendIntent.resolveActivity(getPackageManager()) != null) {
   startActivity(Intent.createChooser(sendIntent, "Send message")); 
}
 1
Author: Prab,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-02-03 07:16:14

Redactar un correo electrónico en el cliente de correo electrónico del teléfono:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
intent.putExtra(Intent.EXTRA_SUBJECT, "subject");
intent.putExtra(Intent.EXTRA_TEXT, "mail body");
startActivity(Intent.createChooser(intent, ""));
 0
Author: ,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-05-26 13:10:21
            Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
                    "mailto", email, null));
            if (emailIntent.resolveActivity(context.getPackageManager()) != null) {
                context.startActivity(Intent.createChooser(emailIntent, "Send Email..."));
            } else {
                Toast.makeText(context, "No apps can perform this action.", Toast.LENGTH_SHORT).show();
            }
 0
Author: Ahamadullah Saikat,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-12-09 16:48:16

Usar intent.setType("message/rfc822"); funciona, pero muestra aplicaciones adicionales que no necesariamente manejan correos electrónicos (por ejemplo, GDrive). Usar Intent.ACTION_SENDTO con setType("text/plain") es lo mejor, pero debes agregar setData(Uri.parse("mailto:")) para obtener los mejores resultados (solo aplicaciones de correo electrónico). El código completo es el siguiente:

    Intent intent = new Intent(Intent.ACTION_SENDTO);
    intent.setType("text/plain");
    intent.setData(Uri.parse("mailto:[email protected]"));
    intent.putExtra(Intent.EXTRA_SUBJECT, "Email from My app");
    intent.putExtra(Intent.EXTRA_TEXT, "Place your email message here ...");
    startActivity(Intent.createChooser(intent, "Send Email"));
 0
Author: Rami Alloush,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-27 23:16:15

Estoy actualizando la respuesta de Adil en Kotlin,

val intent = Intent(Intent.ACTION_SENDTO)
intent.data = Uri.parse("mailto:") // only email apps should handle this
intent.putExtra(Intent.EXTRA_EMAIL, Array(1) { "[email protected] })
intent.putExtra(Intent.EXTRA_SUBJECT, "subject")
if (intent.resolveActivity(packageManager) != null) {
    startActivity(intent)
} else {
    showSnackBar(getString(R.string.no_apps_found_to_send_mail), this)
}
 0
Author: KishanSolanki124,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-09-19 06:57:56

Use Anko-kotlin

context.email(email, subject, body)
 0
Author: Ali hasan,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-09-22 13:10:34