publicstaticvoid email(Context context,String emailTo,String emailCC,String subject,String emailText,List<String> filePaths){//need to "send multiple" to get more than one attachmentfinalIntent emailIntent =newIntent(android.content.Intent.ACTION_SEND_MULTIPLE);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,newString[]{emailTo});
emailIntent.putExtra(android.content.Intent.EXTRA_CC,newString[]{emailCC});//has to be an ArrayListArrayList<Uri> uris =newArrayList<Uri>();//convert from paths to Android friendly Parcelable Uri'sfor(String file : filePaths){File fileIn =newFile(file);Uri u =Uri.fromFile(fileIn);
uris.add(u);}
emailIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
context.startActivity(Intent.createChooser(emailIntent,"Send mail..."));}