Sunday, December 12, 2010

How to attach file in email

Hi this is my first blog hope this will help you.

 attaching file in email is simple here is my code.....

public void sendMail(String emailid,String mailbody){

final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+Environment.getExternalStorageDirectory()+"nameof your file"));
        emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{emailid});
        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,"Transaction Details");
        try {
        this.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
        } catch (android.content.ActivityNotFoundException ex) {
        Toast.makeText(this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();



  1. Sir,

    Can please tell me, how to generate qrcode in android.

    if i have a number how to convert that into qrcode in android. if possible please send the the source code.

    i learned the zxing project but it is having some error.

    Error: Sorry, sorry, the android camera encountered a problem. you may need to restart the device

    My Mail Id:

  2. The nice code written on this post which is useful for me to attach a file in E-mail on android smartphone so thanks for providing this information.

    Android App Development

  3. And, if you are a Gmail user, you do not need to worry about anything. Besides the official Gmail technical support services, the third party Gmail customer service providers are also available at your closest disposal, and you can get any kind of technical support as and when required.
    Gmail Support

  4. To attach a file: Click the Attachment or Include File icon, often represented by a paper clip. Locate the file on your computer's hard drive or other storage device from the window that opens requesting the name of the file. Select the file you want from the file attachment window. game development

  5. You wrote very well your first blog.Thanks for sharing such a informative coding.waiting for your next blogs.

    Android app development company

  6. Thanks for sharing information I must say very informative blog post. Keep it up!!
    Hire Angularjs Developers | Truck Dispatch Software | Taxi App Development