Below is a code snippet to send a file through a share intent. You'll need to specify the file, and it has to be saved in external storage for the email application to access it.
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
// ENTER THE EMAIL ADDRESS AND SUBJECT BELOW
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"email@asu.edu"});
intent.putExtra(Intent.EXTRA_SUBJECT, "Email Subject");
// ENTER THE FILE YOU WANT TO SEND BELOW
intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File()));
startActivity(Intent.createChooser(intent, "Share using"));
Below is a code snippet to send a file through a share intent. You'll need to specify the file, and it has to be saved in external storage for the email application to access it.
Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain");
// ENTER THE EMAIL ADDRESS AND SUBJECT BELOW intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"email@asu.edu"}); intent.putExtra(Intent.EXTRA_SUBJECT, "Email Subject");
// ENTER THE FILE YOU WANT TO SEND BELOW intent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File())); startActivity(Intent.createChooser(intent, "Share using"));