Hi  Forum,

im trying to send an email programaticly. Sending an email which has
an attached image is not the problem. But I need to have an HTML email
which shows the
attached picture in the body itself.
I tried several things but without success... When I compare a email
sourcecode, I can see, that in the HTML body I need to reference the
Content-ID , which is given in the attached file.
In theory  I think if I create an intent object typ html , attaching a
file I need to get the CID number to set it in the body text. I tried
all the intent functions like getdata() or getextradata() etc. but I
didn't find the CID. The next problem is , that the toHTML function is
overwriting my IMG tag , maybe b/c it is unknown ??

did anyone handle this task , can anyone help out here with an
idea ??

here is my source code:



                Intent emailIntent = new
Intent(android.content.Intent.ACTION_SEND_MULTIPLE);

                String aEmailList[] =
{ getResources().getString(R.string.email_address) };

                ArrayList<Uri> uris = new ArrayList<Uri>();

                String file = "test.jpg";

                File filePath = new
File(Environment.getExternalStorageDirectory()+"/"+file);
                Uri u = Uri.fromFile(filePath);
                uris.add(u);

                emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
aEmailList);
                emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
getResources().getString(R.string.email_subject));
                emailIntent.putExtra(android.content.Intent.EXTRA_STREAM, uris);
                emailIntent.setType("text/html");
        
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,Html.fromHtml(new
StringBuilder() .append("<p><b>Some Content</b></p>").append("<img
src=\"/sdcard/test.jpg\" />") .toString()));

                startActivity(emailIntent);

thanks to all
 Mourad

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

Reply via email to