Send HTML Email

I want to send an HTML email as shown below. How can i do this? Please help me. Thanks in advance...!

One

+4
source share
2 answers
String body = new String("<html><body><table><tr><td><br/>" +header+"</td></tr><br/><br/>"+"Get <b> Best Score </b> in your Android Phone.<br/>"+"<a href=\"" + link_val + "\">" + text_value+ "</a>"); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, html.fromHtml(body)); 

Android only supports some tags.

See the link below for more details.

Link1

Link2

+8
source

Use any html editor to create an html page. emailText contains html data. I think this code is pretty obvious.

  final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE); emailIntent.setType("text/html"); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, emailTo); emailIntent.putExtra(android.content.Intent.EXTRA_CC, emailCc); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject); emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, emailText); this.startActivity(Intent.createChooser(emailIntent, "Choose your email program")); 
+1
source

Source: https://habr.com/ru/post/1340743/


All Articles