I have a email body in HTML and I need to attach an text file, xml
file and an image to the email. I am starting with xml

In my app with package name com.danraaka.apper

String filePath = "/data/data/com.danraaka.apper/Results.xml";

Intent emailIntent = new Intent(
                                android.content.Intent.ACTION_SEND);
emailIntent.setType("text/html");
emailIntent.putExtra(Intent.EXTRA_EMAIL,
                                emailAddress);
emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
emailIntent.putExtra(Intent.EXTRA_TEXT, Html.fromHtml(emailBody)); <-
This gives me the HTML
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new
File(filePath)));

result in the email with ZERO bytes.

In the Log for Gmail I see

D/Gmail   ( 6085): ComposeActivity added to message:0 attachment:|
Results.xml|text/html|0|text/html|LOCAL_FILE|file:///data/data/
com.danraaka.apper/Results.xml size:0

I/Gmail   ( 6085): >>>>> Attachment uri: 
file:///data/data/com.danraaka.apper/Results.xml
I/Gmail   ( 6085): >>>>>           type: text/html
I/Gmail   ( 6085): >>>>>           name: Results.xml
I/Gmail   ( 6085): >>>>>           size: 0
D/Gmail   ( 2514): MailEngine.sendOrSaveMessage
messageId=1351537232451731456 refMessageId=0,
conversationId=1351537232451731456

D/Gmail   ( 2514): MailProvider.insert(): added local message 90


Any pointers will be highly appreciated ?

-Madan

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to