1

I am developing an application to send an email with HTML data as the email subject. The HTML contains a table tag in it. But when I get the mail it doesn't look like a table. what is the problem here? the code I used is

Intent emailIntent = new Intent(Intent.ACTION_SEND);
            emailIntent.setType("text/plain"); 
            emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "" });
            emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Medicine Details");

            emailIntent.putExtra(android.content.Intent.EXTRA_TEXT,
                    Html.fromHtml(htmldata));

            startActivity(Intent.createChooser(emailIntent, "Email to Friend"));
XH6 user
  • 3,460
  • 1
  • 12
  • 14
pranavjayadev
  • 937
  • 7
  • 31

1 Answers1

1

A longshot maybe but you can make use of serverbased mail. Your app allready makes use of the internet i guess so you can POST your data to a PHP file that sends the mail in full HTML in all it's glory for you ;)

Switching Brains
  • 290
  • 4
  • 15
  • +1 I had the same issue once. Having a server backend helps in the case. Then the developer don't have to worry about different mail clients installed on the device and their behaviour. (My issue was I didn't had a server backend, and client didn't want to pay for one either) Also, in the question, if you prefer Intent approach make sure the type is set to `message/rfc822` instead of `text/plain` to avoid showing non-email apps in the chooser on some devices. – Madushan Sep 19 '12 at 08:12
  • how can i convert my html file into php. I dont have knowledge in php – pranavjayadev Sep 19 '12 at 09:38
  • If you can create apps for Android you sure can work your way with PHP. Check http://php.net/manual/en/function.mail.php for all the info on sending mail with PHP. – Switching Brains Sep 19 '12 at 13:45