How to use built in email application to send email from my application?

by dilu » Fri, 12 Dec 2008 14:44:11 GMT


Sponsored Links
 Hi
I wanna to send email from my application .I want to use built in
email application to send  mail from my application.So, can any one
provide me some sample code or link for sending email  using built in
email application?Any advice on this topic is most welcome.
Please reply.I am waiting for u people to reply.
Thanks
dilu
--~--~---------~--~----~------------~-------~--~----~



How to use built in email application to send email from my application?

by Peli » Fri, 12 Dec 2008 18:26:50 GMT


  http://www.openintents.org/en/node/121 

Peli
www.openintents.org



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


How to use built in email application to send email from my application?

by blindfold » Fri, 12 Dec 2008 18:52:25 GMT


 Same with me. Basically all I want is to automatically compose an e-
mail with a subject line, recipient address and an image attachment,
and an e-mail app should then pop up with this automatically composed
message, to let the user decide whether to send, edit or discard the
message. My purpose is to let the user e-mail a camera snapshot for
remote OCR analysis. The OCR back-end is already fully functional,
linking to the WeOCR servers in Japan, and is platform-neutral on the
user side, that is, works with any platform (Windows, Symbian, ...),
but it is rather inconvenient for the user to manually compose the e-
mail and figure out which snapshot from what folder to attach.

Thanks

On Dec 12, 11:33am, "dileep singh" <discover.dile...@gmail.com>




--~--~---------~--~----~------------~-------~--~----~



How to use built in email application to send email from my application?

by Mark Murphy » Fri, 12 Dec 2008 20:20:18 GMT


 


Peli has saved our bacon yet again:

 http://www.openintents.org/en/node/121 

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 1.9 Available!

--~--~---------~--~----~------------~-------~--~----~



How to use built in email application to send email from my application?

by Peli » Fri, 12 Dec 2008 22:42:16 GMT


 > Do u have some sample code?

Use the scroll-bar of your browser!

paste it here:

Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "email text");
sendIntent.putExtra(Intent.EXTRA_SUBJECT, "Subject");
sendIntent.setType("message/rfc822");
startActivity(Intent.createChooser(sendIntent, "Title:"));

If you want to know more, it helps to read the documentation ;-)
 http://code.google.com/android/reference/android/content/Intent.html #ACTION_SEND

Peli

On Dec 12, 11:33am, "dileep singh" <discover.dile...@gmail.com>




--~--~---------~--~----~------------~-------~--~----~



How to use built in email application to send email from my application?

by blindfold » Sat, 13 Dec 2008 03:17:38 GMT


 I'd love to see that one extra line in your example that shows how to
add an image file attachment with the image file stored on the SD
card. :-)




--~--~---------~--~----~------------~-------~--~----~



How to use built in email application to send email from my application?

by Peli » Sat, 13 Dec 2008 04:03:19 GMT


 Use the source, Luke!

OI File Manager (  http://www.openintents.org/en/node/159  ) can do
this, so there is a good chance that you will find enlightment
there :-)

 http://code.google.com/p/openintents/source/browse/trunk/FileManager/src/org/openintents/filemanager/FileManagerActivity.java 

It is actually 2 extra lines:

sendIntent.setType("audio/mp3");
sendIntent.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");

I've now posted this on the OI page as well: 
 http://www.openintents.org/en/node/121 

Peli
www.openintents.org




--~--~---------~--~----~------------~-------~--~----~



How to use built in email application to send email from my application?

by Peli » Sat, 13 Dec 2008 04:08:17 GMT


 > I'd love to see that one extra line in your example that shows how to

Oh, sorry, you said image.

sendIntent.setType("image/png");
sendIntent.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/
mygirlfriend.png");

I'm sure the next question is how to have both, subject and
attachment, but I'll leave this as an exercise to the reader :-)

Peli


--~--~---------~--~----~------------~-------~--~----~



How to use built in email application to send email from my application?

by blindfold » Sat, 13 Dec 2008 20:41:52 GMT


 Fabulous Peli! Thank you. I found the online documentation a bit
intimidating at first, but this example gives a great flying start.

Regards



--~--~---------~--~----~------------~-------~--~----~



How to use built in email application to send email from my application?

by Abraham Lincoln » Sun, 04 Jan 2009 08:11:08 GMT


 This doesn't seem to work for regular text file. I have tried giving
mime types of "*/*", "text/plain" etc.

Anyone knows how to attach text files using Gmail? Doesn't even work
from Gmail app.



--~--~---------~--~----~------------~-------~--~----~



How to use built in email application to send email from my application?

by Noam Wolf » Sun, 04 Jan 2009 08:19:54 GMT


 Is there a way to actually send the email without having the user
choose an email client and hitting send? (without using a network
connection and having a server do it on the back end)




--~--~---------~--~----~------------~-------~--~----~