Android :: Sending An Email With An Attachment From An Application
Nov 10, 2010
I'm creating an app that has an "export" feature which converts the user's data into a CSV file, and allows the user to send it as an attachment to somebody (presumably themselves).
The CSV file is created successfully, but when I try to send the email, I encounter a problem. The device looks like it is going to send the email with the appropriate attachment, but when the email is received... there is no attachment at all...
Here is the code I am using to send the email:
CODE:................
View 2 Replies
Apr 1, 2010
I never got this to work on a real device, got the email but no attachment, also when installing K9 on a emulator and then sending the email I see the mail in the outbox with a size of 0 bytes:
public static void sendFile(Context context) { File exportDir = new File(Environment.getExternalStorageDirectory(), "mydir"); if (!exportDir.exists()) { exportDir.mkdirs(); } String csvFile = exportDir + "/file.csv"; File file = new File(csvFile); if(file.exists()) { Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_SUBJECT, "CSV file"); sendIntent.setType("text/csv"); //sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); //sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + Environment.getExternalStorageDirectory() + "/mydir/file.csv")); sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///sdcard/ mydir/file.csv")); context.startActivity(Intent.createChooser(sendIntent, "Send CSV file")); } else { Util.displayToast(context, R.string.no_csv_file); } }
View 11 Replies
View Related
Aug 7, 2009
I am trying to send an email using native email client on android phone. I have tried following ways to add an attachment to the mail.
Method 1 Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.setType("image/jpeg"); sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://sdcard/ abc.jpg"));
Method 2
Sending the image as body content
sendIntent.putExtra(Intent.EXTRA_TEXT, "<HTML><BODY><b><IMG SRC= "data:image/jpeg;base64," + <imagepath> + ""alt = "pleaseview this image"/></b></BODY></HTML>");
I can successfully attach the image manually but when I tried to attach and send it programmatically the mail was sent without attachment.
View 5 Replies
View Related
Jun 30, 2009
I just copy the code from http://www.openintents.org/en/node/121 to test if I can send .txt or .mp3 file as email attachment, Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.setType("audio/mp3"); sendIntent.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3"); sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject"); startActivity(Intent.createChooser(sendIntent, "Title:"));
But I got an error said that No applications can perform this action. My android sdk is cupcake1.5, and I have already set up my gmail acount in Email application. Anyone knows why? If I set the type as "*/*"(sendIntent.setType("*/ *");), it can launch the Email activity but with no attachment.
View 5 Replies
View Related
Nov 20, 2010
I cannot send an email with an attachment using the Gmail app on this phone. I tried to send three different photographs to three different email addresses and it failed every time. Emails without attachments go perfectly every time.
View 6 Replies
View Related
Aug 22, 2010
Is it possible to set up a form in an application and have the person filling out the form send the information to you? If so could I get some examples?
View 1 Replies
View Related
May 12, 2009
I have tried to send email from myapplication in emulator, with following code.
CODE:.......
But i got an error "No applications can perform this action".
I tried by configuring Gmail in emulator, with the following code
CODE:.....
But i got an error but i got an error "java.lang.verifyError:javax.mail.internet.Mimemessage."
View 3 Replies
View Related
Apr 6, 2010
I followed this stackoverflow thread to implement EmailSender using Javamail on Android. But I am still getting this exception: Could not connect to SMTP host: smtp.gmail.com, port: 465. I am using Android 1.6.
View 2 Replies
View Related
Jan 7, 2010
I am trying to create a mail sending application in android, If I use
`Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND`);
This will launch the builtin application of android, I'm trying to send the mail on button click directly without using this app.
View 12 Replies
View Related
Nov 12, 2009
I have an issue with my Gmail app where I think no information is being 'sent' from the phone. I receive incoming mails, but no mails are sent. Though I delete incoming mails, the next notification which I receive when I get the next mail will show "17 mails" though I would have deleted the previous 16 emails. When I check email on my browser, all the emails what I had deleted are still there. I have tried a factory reset and I still have a problem.
View 1 Replies
View Related
Feb 15, 2010
I try to send numerous emails through the Gmail app and they won't send. They sit in my Outbox and never send. Is anyone else having this issue, or had this issue and care to help how to reslove it? I had the Smoked Glass Rom, but switched back to my old edited rooted nandroid backup, then even tried the OEM version I had backed up, but it still won't send.
View 19 Replies
View Related
Jun 26, 2010
So I've never used Gmail before and I'm playing around with it. I've sent two emails and both have been sitting in my outbox for over 5 minutes. Is there normally this long of a delay in sending email with the Gmail app and is there a way to change it.
View 2 Replies
View Related
Aug 8, 2010
I have the Samsung Captivate and I'm totally new. I'm having problems opening my email attachments (pdf and xls). I found this thread, but I'm still confused. I can't seem to find "open unknown apps" nor "Unknown Sources" in my Settings.
View 5 Replies
View Related
Jan 10, 2010
I want to open a specific type of file that my app can already send over email as an attachment. I need to be able to have the android email app choose my app to download or open that specific file type. I can't figure out how to set up an intent filter that would let me do that though. Anyone know how this is done?
View 1 Replies
View Related
Sep 10, 2009
how to send a zip file as an attachment of an email?
Intent sendIntent = new Intent(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto); sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Sample"); sendIntent.setType("application/zip"); sendIntent.putExtra(Intent.EXTRA_STREAM,pathtozipfile);
startActivity(Intent.createChooser(sendIntent,"send the mail"));
I tried about snippet.But didnt work. Anybody tried sending zip file attachments?
View 2 Replies
View Related
Aug 9, 2010
I have built a test android app and signed it successfully and then sent it to someone to test via email. They click on the attachment in the email on their android phone and get a parsing error.
View 2 Replies
View Related
Mar 11, 2010
I wanted to know what is the maximum size of the file that we can attach with email in android? Or is the attachment limit completely dependent on E-mail that we have configured?
View 1 Replies
View Related
Aug 12, 2010
Had the phone now two weeks. Got the upgrade to 2.2 from sprint succesfully. Enjoying the power of this machine for sure. I lurk here a lot and have learned tons for sure from reading, reading, reading sometimes till the wee hours. Three things I still can't seem to figure out. 1. Opening an attachment in an email: When a pic or doc file comes in I can't seem to view it. I click "view attachment" it shows the name of the file and the size but does not open the file or download it for me to see. What am I doing wrong? Some kind of settings issue maybe? 2. Deleting a file: I downloaded a pdf file off the internet and now I wish to delete it. Menu does not show an option to delete when I am viewing thde file with pdf viewer. Any ideas? 3. Voice email: I love the voice texting, voice emailing, etc but when I open an email to compose new and use the speak option to speak the name of a current contact (who has an email as part of his contact info) it does not try to auto fill that like it would if I hand texted it in. In other words, say I begin a new email and in the TO box I click the microphone and speak john smith. It types his name in but does not recognize him from contacts and fill in his email address like it does if I start to type j o h n s m by hand. I must be doing something wrong here too maybe?
View 4 Replies
View Related
Sep 7, 2010
I received an email in my Gmail acct with a pdf attachment, and I want to download it. I can preview the file but I see no option to save it to my SD card or Dropbox or anything. Any tips on saving a pdf on the DINC?
View 5 Replies
View Related
Jan 27, 2010
I receive MP4 attachments from my Linksys G54 camera but Droid plays the file on rare occasions. Sometimes it plays and other times it will not play even the same file.
View 3 Replies
View Related
Feb 29, 2012
I am using the OEM Android email app. Attacing a picture is no problem. If I try and attach say a video of 5 plus mb it won't attach. I get an error message telling me file is too large to attach.
(I have a ZTE Blade running Android 2.3.7 on a Cyanogenmod ROM 7.10.)
I have two questions.
- what is the maximum permisable file size for attachments;
- can the file size limit be increased in anyway?
View 1 Replies
View Related
Mar 14, 2010
what the maximum file size is I can attach to an outgoing email using Gmail? I know Gmail allows 20 megabytes, but is there a size limit I can attach from the Hero? I have had the phone tell me a file is too big to attach, but it was well under 20 megs.
View 4 Replies
View Related
Feb 15, 2010
After installing BBeast I can't open the attachment on my Email..
Anyone know how to fix this?
View 1 Replies
View Related
Sep 20, 2010
In my android, how can I launch android's compose email activity with an attachment attached?
View 1 Replies
View Related
Sep 30, 2010
I have my work email setup in the email app. Ive never had an issue sending email on any phone ive had before.
All of my settings are correct and i can receive them fine.
They just sit in outbox and whenever i go select them all and tell it to send selected messages nothing happens. They don't send and I don't get any error or anything.
View 2 Replies
View Related
Oct 24, 2008
I've hit my first real usability snag with the G1.I tried to send a word processing file to someone via the gmail client on the G1 today, and found that I could select only photos and no other file type for attachments.So I fired up the browser and went to the desktop version of the gmail web site, and in the composition window, the button under the attachments section is captioned "Uploads Disabled" instead of the usual "Browse."Does anyone have a workaround for emailing non-jpeg attachments? This is a feature that I need to use on practically a daily basis. Any developers out there working on an email client, please support this feature.
View 37 Replies
View Related
Feb 14, 2009
I am looking for a way to send an email from a specified email (that I predefine the username, password, etc.) to a different specified email that I have in the string.
View 2 Replies
View Related
Jul 19, 2010
I started a thread that wound up in the Droid X Troubleshooting forum, but I think this is an Android problem, not a Droid X problem... I'm having read receipt issues with the stock Gmail app (it won't let me send them and it auto-sends them to people who request them of me, without giving me the option of sending or declining). In addition, I'm pretty disappointed with the Gmail app, especially when compared to the Blackberry's handling of Gmail. Blackberry's only gmail issue is when you send an email to someone through gmail you get a copy regardless of whether you want one or not.
I'm really concerned about this and would love to find an alternative -- K9 doesn't appear to be compatible with GMail so even if I wanted to I couldn't use that. Anyone have any suggestions? The web interface, incidentally, doesn't feature read receipts -- already considered logging in to send important emails that way. I'm guessing if there's no alternative then the only alternative is to return to my Blackberry for the time being :-/
View 5 Replies
View Related
Apr 5, 2010
Is there and accepted way to send an email in the background?
View 10 Replies
View Related
Aug 11, 2010
In my application, on click of a button, I start an intent to send email. I have set the "To" list, "Subject" and attachment in my coding. Now my problem is that when the email screen is shown, user should not be able modify the email contents nor should he be allowed to remove the attachment. Only he should be able to click on "Send" button.
View 1 Replies
View Related