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:
- How to change font color to red
- How to bold text
- How to set text to center
- How to change font size of text 5.How to change the background of the whole email to blue?????