Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7505125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:48:16+00:00 2026-05-29T21:48:16+00:00

I am developing an app which requires to send email to a person. Everything

  • 0

I am developing an app which requires to send email to a person. Everything works fine except the attachment. And here is the piece of code for that

 emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(  "file://"+Environment.getExternalStorageDirectory()+""+attach));

attach is the file i got by browsing in the phone.
But the attachment is not being sent Please Help.

Thanx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T21:48:19+00:00Added an answer on May 29, 2026 at 9:48 pm

    According to my blogpost found here:

    Creating a mail on Android which the user may send with the app of his
    choice is widely spread on the net. But it isn’t how you attach a file
    which will be send by googlemail.

    The problem here is that the gmail app only want to send files which
    are located on the sdcard

    Intent mail = new Intent(android.content.Intent.ACTION_SEND);
    mail.setType("application/octet-stream");
    mail.putExtra(android.content.Intent.EXTRA_EMAIL, new String[] {"my@mail.com"});
    mail.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
    mail.putExtra(android.content.Intent.EXTRA_TEXT, "Message");
    mail.putExtra(android.content.Intent.EXTRA_STREAM, Uri.parse("file://" + Environment.getExternalStorageDirectory().getAbsolutePath() + "/file.txt"));
    PrefAct.startActivity(Intent.createChooser(mail, "Send mail via..."));
    

    As said gmail will refuse your attachment when the user sends the mail
    when the file isn’t located on the ExternalStorage.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i got the following problem: I am developing an app which requires the zxing-QR-Code
I am developing a web app which requires a username and password to be
I have been developing an app in VB.NET which requires a control object (for
I am developing an app which requires interaction with a SOAP web service, to
I am developing an android app which requires route guidance in a map in
I am developing an android app which requires search functionality. My app contains action
I am developing an iPhone app which requires charts. Hence I am using API
I am developing an app which requires JSON. I use the link https://maps.googleapis.com/maps/api/place/autocomplete/json?input=+place+&types=geocode&sensor=true&key=AIzaSyCA4LKD6QfiCrGhZjCsYiRyEGqxKOUEQBU ,
I'm developing an app which requires threaded sms. I was able to retrieve contents
Hi i'm developing an application which requires me to run some bash code is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.