I send mail through my application. For this, I use the following code.
Intent i = new Intent(Intent.ACTION_SEND); i.setType("text/plain"); i.putExtra(Intent.EXTRA_EMAIL , new String[]{" recipient@example.com "}); i.putExtra(Intent.EXTRA_SUBJECT, "subject of email"); i.putExtra(Intent.EXTRA_TEXT , "body of email"); try { startActivity(Intent.createChooser(i, "Send mail...")); } catch (android.content.ActivityNotFoundException ex) { Toast.makeText(MyActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show(); }
It just works fine, but I want to attach an xml file to it. Is it possible? How?
source share