send .doc file as an attachment to mail
<p>i want to send a .doc file as an attachment via email.</p>

<p>i am using the code below:</p>

<pre><code>final Intent emailIntent = new Intent(
                                android.content.Intent.ACTION_SEND);

                        emailIntent.setType("plain/text");

                        emailIntent.putExtra(
                                android.content.Intent.EXTRA_SUBJECT,
                                "Song Pad.");

                        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
                                "Please see the attached document.");

                        final File file = new File(dirPath + "/" + filename
                                + ".doc");
                        emailIntent.putExtra(Intent.EXTRA_STREAM,
                                Uri.parse("file://" + file.getAbsolutePath()));

                        MainActivity.this.startActivity(Intent.createChooser(
                                emailIntent, "Send Email..."));
</code></pre>

<p>the attachment goes successfully to email but when i open it on device it shows message</p>

<p><strong>Unable to find viewer for plain/text</strong>.</p>

<p>on the other hand when i send doc file not via my app then it opens perfectly.</p>

<p>please guide . i think there is little mistake..
thanks..</p>
