title: How to send an email with a file attachment in Android
body: <p>I want to attach .vcf file with my mail and send through the mail. But the mail is received on the address without the attachment.I have used the below code but the code for this and i don't know where i am wrong.</p>
  
  <pre><code>try {      
    String filelocation="/mnt/sdcard/contacts_sid.vcf";      
    Intent intent = new Intent(Intent.ACTION_SENDTO);    
    intent.setType("text/plain");      
    intent.putExtra(Intent.EXTRA_SUBJECT, "");      
    intent.putExtra(Intent.EXTRA_STREAM, Uri.parse( "file://"+filelocation));      
    intent.putExtra(Intent.EXTRA_TEXT, message);         
    intent.setData(Uri.parse("mailto:"));         
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
  
    activity.startActivity(intent);
    activity.finish();
    } catch(Exception e)  {
       System.out.println("is exception raises during sending mail"+e);
  }
  </code></pre>