how to embed html in email body ?

by Makrand » Sat, 27 Feb 2010 13:54:24 GMT


Sponsored Links
 Hello

I am trying to send a email by using Intenet, and i am trying to add
HTML page in email body,

but in compose box its showing only HTML code, its not rendering.

so how to add HTML in Email body.

Here is my Java code

Intent sendIntent = new Intent(Intent.ACTION_SEND);
          sendIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          sendIntent.setType("text/html");
          sendIntent.putExtra(Intent.EXTRA_EMAIL, mailto);
          sendIntent.putExtra(Intent.EXTRA_SUBJECT,
emailSubject.getText()
                    .toString());
          sendIntent.putExtra(Intent.EXTRA_TEXT, htmlString);
startActivity(Intent.createChooser(sendIntent, "Email"))

the "htmlString" contains my HTML code

Here is my HTML code

html>
<head>
  <meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
  <meta content="width = device-width" name="viewport">
</head>
<body>
<h3>Hello world !!!!!</h3>
</body>
</html>

Please help me !!!!!

--



Other Threads

1. Resolving activities

In a test app I pass an intent to resolveActivity to find out what is
the
best fit for the intent.

For example:

   Intent myIntent = new Intent();

   myIntent.setPackage(PackageName);
   myIntent.addCategory(Intent.CATEGORY_LAUNCHER);
   myIntent.setAction(Intent.ACTION_MAIN);

   PackageManager manager = getPackageManager();

   ResolveInfo ri = manager.resolveActivity(exceptionIntent,0);

   if (ri != null) {
         Intent newIntent = new Intent();

         newIntent.setClassName(PackageName,
ri.activityInfo.applicationInfo.className);
         newIntent.setFlags(ri.activityInfo.flags);

         startActivity(newIntent);
      }

The result of all this is an error:
"android.content.ActivityNotFoundException: Unable to find explicit
activity
                                               class ......."

Any suggestions or thoughts on why I am getting back an activity that
then can't be
found by startActivity?

-- 

2. Application throws exception when I rotate the device

It throws Exception as

07-11 12:45:05.145: ERROR/AndroidRuntime(2871): FATAL EXCEPTION: main
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):
java.lang.IllegalArgumentException: View not attached to window
manager
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:
355)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.view.WindowManagerImpl.removeView(WindowManagerImpl.java:200)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.view.Window$LocalWindowManager.removeView(Window.java:432)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.app.Dialog.dismissDialog(Dialog.java:278)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.app.Dialog.access$000(Dialog.java:71)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.app.Dialog$1.run(Dialog.java:111)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.os.Handler.handleCallback(Handler.java:587)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.os.Handler.dispatchMessage(Handler.java:92)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.os.Looper.loop(Looper.java:123)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
android.app.ActivityThread.main(ActivityThread.java:4627)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
java.lang.reflect.Method.invokeNative(Native Method)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
java.lang.reflect.Method.invoke(Method.java:521)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-11 12:45:05.145: ERROR/AndroidRuntime(2871):     at
dalvik.system.NativeStart.main(Native Method)

-- 

3. Need help setting up my device for development

4. how to deal with button clickevent in a listview?

5. Tabacitivty

6. newbie mau nanya ttg psr ml

7. Mirink Springhill updated