code: public static Intent newEmailIntent(String[] addresses, String subject, String body, Uri attachment) {
          Intent intent = new Intent(Intent.ACTION_SEND);
          if (addresses != null) intent.putExtra(Intent.EXTRA_EMAIL, addresses);
          if (body != null) intent.putExtra(Intent.EXTRA_TEXT, body);
          if (subject != null) intent.putExtra(Intent.EXTRA_SUBJECT, subject);
          if (attachment != null) intent.putExtra(Intent.EXTRA_STREAM, attachment);
          intent.setType(MIME_TYPE_EMAIL);
  
          return intent;
      }
docs: Create an intent to send an email with an attachment
  
  @param addresses  The recipients addresses (or null if not specified)
  @param subject    The subject of the email (or null if not specified)
  @param body       The body of the email (or null if not specified)
  @param attachment The URI of a file to attach to the email. Note that the URI must point to a location the email
  application is allowed to read and has permissions to access.
  @return the intent