0

So far I have this code:

String user_email = emails.getText().toString().trim();

        String[] TO = {user_email};
        String[] CC = {user_email};
        Intent emailIntent = new Intent(Intent.ACTION_SEND);
        emailIntent.setData(Uri.parse("mailto:"));
        emailIntent.setType("text/html");

        emailIntent.putExtra(Intent.EXTRA_EMAIL, TO);
        emailIntent.putExtra(Intent.EXTRA_CC, CC);
        emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Coinchain notifications");
        emailIntent.putExtra(Intent.EXTRA_TEXT,
                Html.fromHtml(new StringBuilder()
                        .append("<p><b><font color=#ffffff>Some text 1</font></b></p>")
                        .append("<small><p>Some text 2</small>")
                        .append("<font color='#FE2B3C'>Some text 3</font>")
                        .append("<a>http://google.com</a>")
                        .toString()
                )
                );

        try {
            startActivity(Intent.createChooser(emailIntent, "Send mail..."));
            finish();
            Log.i("Email sent successfully!", "");
        } catch (android.content.ActivityNotFoundException ex) {
            Toast.makeText(Emails.this,
                    "There is no email app installed.", LENGTH_SHORT).show();
        }

As you can see from my code I am trying these things: To change some text 3 to red color or any different, when I click the button to launch gmail app, all the text is plain, and no color changing everything is plain and has default colors black.

my questions:

  1. How to change font color to red
  2. How to bold text
  3. How to set text to center
  4. How to change font size of text 5.How to change the background of the whole email to blue?????
binoe
  • 3
  • 4
  • https://stackoverflow.com/questions/30456896/changing-the-colour-of-text-string-when-sending-an-email – Usama Altaf Jan 15 '21 at 11:48
  • This answer does not have the answers I am looking for, anyway on color changing I did as this answer says but no change – binoe Jan 15 '21 at 11:51

0 Answers0