I am sending an email through intent, here I want to set CSS styles to the body of email, I have already referred many questions and answers on Stack and found below code:
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/html");
intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"[email protected]"});
intent.putExtra(Intent.EXTRA_SUBJECT, "I would like to buy the following");
intent.putExtra(android.content.Intent.EXTRA_TEXT, Html.fromHtml(body));
startActivity(Intent.createChooser(intent, "sending mail"));
but this code sets only text in email body and skips my css styles, how do I achieve that? I want to set background color, text size, text color to the email body all through Android intent.
Found an answer on this SO post, according to this gmail doesn't support css in Head and Body tag in html.
Also see this link for more about Css support in browsers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With