Android Email Send sendEmail(Activity oActivity, String strTo, String strSubject, String strText)

Here you can find the source of sendEmail(Activity oActivity, String strTo, String strSubject, String strText)

Description

send Email

Declaration

public static void sendEmail(Activity oActivity, String strTo,
            String strSubject, String strText) 

Method Source Code

//package com.java2s;

import android.app.Activity;

import android.content.Intent;

public class Main {
    public static void sendEmail(Activity oActivity, String strTo,
            String strSubject, String strText) {
        final Intent emailIntent = new Intent(
                android.content.Intent.ACTION_SEND);
        emailIntent.setType("text/plain");
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
                new String[] { strTo });
        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
                strSubject);/*from  w w  w  . j  av  a 2s  .  c  o m*/
        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, strText);
        oActivity.startActivity(Intent.createChooser(emailIntent,
                "Send mail..."));
    }
}

Related

  1. sendEmail(@Nonnull Context context, @Nullable String chooserMessage, @Nonnull String[] recipients, @Nullable String subject, @Nullable String message)
  2. sendEmail(@Nonnull Context context, @Nullable String chooserMessage, @Nullable String recipient, @Nullable String subject, @Nullable String message)
  3. shareViaEmail(Context context, String subject, String text)