my app sends a email when i press a button. I need to attach a .csv file. Here's the code:
Intent email = new Intent(Intent.ACTION_SEND);
        File file = new File(Environment.getExternalStorageState()+"/storage/sdcard0/myfile.csv");
        Uri path = Uri.fromFile(file);
        email.putExtra(Intent.EXTRA_EMAIL, new String[]{"aaa@xxx.it"});
        email.putExtra(Intent.EXTRA_SUBJECT, "Some text");
        email.putExtra(Intent.EXTRA_TEXT, "Some text");
       email.putExtra(Intent.EXTRA_STREAM, path);
        email.setType("application/octet-stream");
        startActivityForResult(Intent.createChooser(email, "Select client"),1222);
When I run the app, and I press the Send-button, a popup comes out and I choose the client email. When the client is opened, I can read the text, the subject, the email and I can see on the bottom the attachment (the .csv file). But when I send the Email, the receiver doesn't have any attachment.
 
    